SYMTAB and DYNSYM tables relationship question
Mike Frysinger
vapier@gentoo.org
Thu Jul 1 00:10:00 GMT 2010
On Wednesday, June 30, 2010 06:21:51 Vladimir Simonov wrote:
> I have ELF executable (EXE) dynamically linked with DSO (SO) on
> some dos-like OS with ELF support. Some symbol A (FUNC GLOBAL DEFAULT)
> is referenced only from SO(not from EXE itself). After link
> (by ld, binutils 2.20.1) EXE contains info about symbol A only
> in DYNSYM table. There is nothing about A in SYMTAB and .rel.text.
> As result our runtime linker is unable to find symbol A during SO
> loading. If I reference A from EXE, A appears in SYMTAB, DYNSYM
> and .rel.text and runtime works OK.
>
> Questions:
> 1. Must symbol A be in SYMTAB and .rel.text if it is not
> referenced from EXE directly? By other words, is the problem
> in ld or in runtime linker?
> 2. If the problem is in runtime linker, then is it possible
> to force such records creation without explicit reference on A
> from EXE sources? Via ld's version-script, may be options...
your ldso should be using DT_STRTAB and DT_SYMTAB for the strtab and dynsym
sections. you shouldnt be relying on named sections to find the symbol table.
to speak to common ELF conventions, .dyn{str,sym} contain only the important
symbol references. the .{sym,str}tab sections contain extended debug info and
are usually stripped from "released" ELFs.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20100701/db222423/attachment.sig>
More information about the Binutils
mailing list