This is the mail archive of the binutils@sourceware.cygnus.com 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]

finding the file of a local symbol in BFD



In an ELF symbol table, all local symbols (e.g., C static things) come
at the beginning of the symbol table.  As I understand it, all the
local symbols from a given compilation unit come in a clump, preceded
by an STT_FILE symbol whose name is the name of the source file for
that compilation unit.  So, given this information, you can discover
which compilation unit a symbol is local to, and thus you can reliably
distinguish between local symbols with the same name.

Is this correct?

In BFD, STT_FILE symbols have the BSF_FILE flag associated with them.
Does BFD guarantee to preserve the order of the symbols?  That is,
will the symbols as I retrieve them from BFD still appear ordered by
compilation unit and preceded by a BSF_FILE symbol?

How portable is this information?  Is there any way to determine the
compilation unit to which a local symbol belongs that works regardless
of the underlying object file format?

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