[Bug c/100483] Extend -fno-semantic-interposition to global variables

i at maskray dot me gcc-bugzilla@gcc.gnu.org
Sun May 16 21:13:14 GMT 2021


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

Fangrui Song <i at maskray dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #5 from Fangrui Song <i at maskray dot me> ---
(In reply to Jan Hubicka from comment #3)

Thanks for the clarification. I misinterpreted the documentation.
Then it seems that -fno-semantic-interposition is a very safe optimization for
distributions to default to. Closing as intended.

I will try changing Clang to drop the local aliases for variables.
It is tricky not to use local aliases for address taking of functions, though.
Fortunately, this will not cause any problems once we do
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593

(In reply to H.J. Lu from comment #4)

I will much appreciate it if you want to fix some copy relocations/canonical
PLT entries
issues so that it will be more easy for distributions to switch to something
like a default
-Wl,-Bsymbolic-global-functions.
What does ld.so do for the proposed GNU_PROPERTY_SINGLE_GLOBAL_DEFINITION? Does
it apply to
STB_GLOBAL or also STB_WEAK?
Does it add all definitions to a global namespace to enforce single definition
for every candidate?
If it does the additional check, this would further slow down dynamic linking.

And I believe we should do the function oriented non-interposition-by-default
plan, which will not be blocked by copy relocation elimination.
(https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic#copy-relocations)


More information about the Gcc-bugs mailing list