dyninst/Object-elf.patch

30 lines
1.5 KiB
Diff
Raw Normal View History

# workaround for https://github.com/dyninst/dyninst/issues/396
--- ./dyninst-9.3.2/symtabAPI/src/Object-elf.C.sv 2017-09-27 21:43:18.399429243 -0400
+++ ./dyninst-9.3.2/symtabAPI/src/Object-elf.C 2017-09-27 21:56:14.485125928 -0400
@@ -1445,6 +1445,24 @@
if (fbt_iter == -1) { // Create new relocation entry.
relocationEntry re( next_plt_entry_addr, offset, targ_name,
NULL, type );
+ if (type == R_X86_64_IRELATIVE) {
+ vector<Symbol *> funcs;
+ dyn_hash_map<std::string, std::vector<Symbol *> >::iterator iter;
+ // find the resolver function and use that as the
+ // caller function symbol. The resolver has not run
+ // so we don't know the ultimate destination.
+ // Since the funcsByOffset map hasn't been setup yet
+ // we cannot call associated_symtab->findFuncByEntryOffset
+ for (iter = symbols_.begin(); iter != symbols_.end(); ++iter) {
+ std::string name = iter->first;
+ Symbol *sym = iter->second[0];
+ if (sym->getOffset() == (Offset)addend) {
+ // Use dynsym_list.push_back(sym) instead?
+ re.addDynSym(sym);
+ break;
+ }
+ }
+ }
re.setAddend(addend);
re.setRegionType(rtype);
if (dynsym_list.size() > 0)