[Bug lto/82575] [8 Regression] lto debugobj references __gnu_lto_slim, ld test liblto-17 fails

amodra at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 19 13:26:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82575

--- Comment #7 from Alan Modra <amodra at gmail dot com> ---
> --- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
> OK. I suppose they are properly prevailed by any global symbol of the same name
> as well? Like a weak definition with default visibility? Or is there the chance
> of linker diagnostics about 'mismatches'? 

Yes, I think they should be OK.  The ELF gABI says of hidden symbols:

"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."

With luck, linkers will choose the first option.

Also:

"First, all of the non-default visibility attributes, when applied to a symbol
reference, imply that a definition to satisfy that reference must be provided
within the current executable or shared object. If such a symbol reference has
no definition within the component being linked, then the reference must have
STB_WEAK binding and is resolved to zero."

Which is why I made the symbol weak as well as hidden.  Otherwise
there may well have been a warning.


More information about the Gcc-bugs mailing list