Bug 12374 - ld fails to convert global hidden symbols to local ones
Summary: ld fails to convert global hidden symbols to local ones
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-07 16:24 UTC by Jan Beulich
Modified: 2011-02-14 08:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
trivial example (49 bytes, application/octet-stream)
2011-01-07 16:24 UTC, Jan Beulich
Details

Note You need to log in before you can comment on or make changes to this bug.
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.