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