[Lldb-commits] [lldb] r132582 - /lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Peter Collingbourne peter at pcc.me.uk
Sun Jun 5 09:35:29 PDT 2011


On Fri, Jun 03, 2011 at 02:08:58PM -0700, Greg Clayton wrote:
> Another clarification I meant to initially convey, so one more time:
> 
> Will the content of SHT_SYMTAB always contain the all the same symbols found in SHT_DYNSYM and more symbol (symbols that aren't required by the dynamic loader)? Or do the symbols for the dynamic loader only get put into the SHT_DYNSYM sections, and any other symbols get put into the SHT_SYMTAB sections? 
> 
> Shouldn't we just parse the SHT_SYMTAB sections and fall back to the SHT_DYNSYM section(s) if there are no SHT_SYMTAB sections?

Hi Greg,

Generally .dynsym is a subset of .symtab (if present), and this does
seem to be an implicit rule in the ELF specification [1].  However,
in practice this rule is not always adhered to (I have at least one
(shared) object file on my system in which both .dynsym and .symtab
are present but .dynsym is not a subset of .symtab).  So I think
the safest thing to do is to parse both symbol tables, under the
"be lenient in what you accept" principle.

Is it a problem to have duplicate symbols in Symtab?  If we do this,
should we be filtering out duplicates somehow?

Thanks,
-- 
Peter

[1] http://www.skyfree.org/linux/references/ELF_Format.pdf page 1-10



More information about the lldb-commits mailing list