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

--- Comment #11 from Fangrui Song <i at maskray dot me> ---
To enable interposition on Mach-O, one needs a non-default configuration like:
ld -interposable, DYLD_FORCE_FLAT_NAMESPACE or
__attribute__((section("__DATA,__interpose"))).
On PE/COFF, such interposition just doesn't exist.

Having an option for -fno-semantic-interposition will actually improve
portability.

(The -fno-semantic-interposition thing is probably the biggest performance gap
between gcc -fpic and clang -fpic.)

As I said previously, -fvisibility=protected cannot be used because protected
visibility is very broken in the GCC/GNU ld system and there is no signal it
will be fixed anytime soon:
https://maskray.me/blog/2021-01-09-copy-relocations-canonical-plt-entries-and-protected#summary

Reply via email to