Blame SOURCES/Object-elf.patch

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