[Bug 233397] llvm-objdump doesn't work with statically linked binary: "index past the end of the symbol table"
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Nov 27 21:11:08 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233397
--- Comment #10 from Ed Maste <emaste at freebsd.org> ---
/usr/local/bin/objdump: a.out symbol number 1030 references nonexistent
SHT_SYMTAB_SHNDX section
/usr/local/bin/objdump: a.out: File in wrong format
% readelf -s a.out | grep '^ *1030:'
1030: 0000000000000000 0 NOTYPE LOCAL HIDDEN 65535 __rela_iplt_end
These symbols are added by:
// The beginning and the ending of .rel[a].plt section are marked
// with __rel[a]_iplt_{start,end} symbols if it is a statically linked
// executable. The runtime needs these symbols in order to resolve
// all IRELATIVE relocs on startup. For dynamic executables, we don't
// need these symbols, since IRELATIVE relocs are resolved through GOT
// and PLT. For details, see http://www.airs.com/blog/archives/403.
template <class ELFT> void Writer<ELFT>::addRelIpltSymbols() {
if (!Config->Static)
return;
StringRef S = Config->IsRela ? "__rela_iplt_start" : "__rel_iplt_start";
addOptionalRegular(S, InX::RelaIplt, 0, STV_HIDDEN, STB_WEAK);
S = Config->IsRela ? "__rela_iplt_end" : "__rel_iplt_end";
addOptionalRegular(S, InX::RelaIplt, -1, STV_HIDDEN, STB_WEAK);
}
So what I think happens is when we have ifuncs these special symbols are
emitted with Ndx set to the appropriate iplt section (.rela.plt), but when we
have no ifuncs we still emit the symbols but there is no section for them to
refer to.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list