Blame SOURCES/Object-elf.patch

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