Blame SOURCES/Object-elf.patch

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