This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can ELF file contain more than one symbol table?


> Can ELF file contain more than one symbol table?
> Is it standardized somehow?

Most executable main programs contain three symbol tables:
a DT_SYMTAB table and a .gnu.version table that are used
by the runtime dynamic loader/linker, and a .symtab SHT_SYMTAB
table that is used by the static loader/binder and by debuggers.

There ELF file format specification itself places no restriction
on the number of any kind of symbol tables, although most
producers and most consumers pay attention to at most one
(usually the last or the first) of a particular kind.

$ readelf --all hello  |  grep -i sym
  [ 5] .dynsym           DYNSYM           0000000000400280  00000280
  [ 7] .gnu.version      VERSYM           000000000040031e  0000031e
  [28] .symtab           SYMTAB           0000000000000000  00001218
 0x0000000000000006 (SYMTAB)             0x400280
 0x000000006ffffff0 (VERSYM)             0x40031e
Symbol table '.dynsym' contains 4 entries:
Symbol table '.symtab' contains 64 entries:
Version symbols section '.gnu.version' contains 4 entries:

-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]