Bug 12374

Summary: ld fails to convert global hidden symbols to local ones
Product: binutils Reporter: Jan Beulich <jbeulich>
Component: ldAssignee: unassigned
Status: RESOLVED INVALID    
Severity: normal CC: amodra
Priority: P2    
Version: 2.21   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: trivial example

Description Jan Beulich 2011-01-07 16:24:06 UTC
Created attachment 5183 [details]
trivial example

The version of the spec I have says "A hidden symbol contained in a relocatable object must be either removed or converted to STB_LOCAL binding by the link-editor when the relocatable object is included in an executable file or shared object." Nevertheless I see global hidden symbols in executables.

Attaching a trivial sample, to be run through

as -o hidden.o hidden.s
ld -o hidden hidden.o
objdump -t hidden
Comment 1 Alan Modra 2011-02-14 00:24:03 UTC
I think this is really just a weakness in the gabi spec.  The symbol table that matters for correct implementation of hidden symbols is the dynamic symbol table.  GNU ld does remove hidden symbols from .dynsym.
Comment 2 Jan Beulich 2011-02-14 08:05:14 UTC
Indeed, as was clarified on the mailing list.