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]

.symtab behaviour query


Hi All,

I have a question about binutils behaviour w.r.t the binding of symbols in
the .symtab section in a linked elf.

I was trying to understand the rationale behind the properties of the
symbols in the .symtab in a linked elf. Gold and GNU-ld change the binding
of symbols to STB_LOCAL when symbols have been resolved as having hidden
visibility. The Gold behaviour was added in:
https://sourceware.org/bugzilla/show_bug.cgi?id=9836, based off the
original GNU ld behaviour added in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17089. I found a reference to
this in the sun linker guide which states " A hidden symbol contained in a
relocatable object is either removed or converted to STB_LOCAL binding when
the object is included in an executable file or shared object. " see:
https://docs.oracle.com/cd/E19120-01/open.solaris/819-0690/chapter6-79797/index.html

As far as I know the symbols in the .symtab section for a linked elf are
really only there to convey debugging information to binary tools and
debuggers. My question is: what is the rationale for the linkers behaviour
here?

If anyone can help with this it would be much appreciated!


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