https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386
--- Comment #49 from Alexander Monakov <amonakov at gcc dot gnu.org> --- Aha, and I see the kernel employs the trick of preincluding a file containing ' '#pragma GCC visibility push(hidden)' when building PIE objects since 2020. So the mcount-emitting macro in the i386 backend creates a corner case. I tried to look up how a.out shared libraries worked, but it's hard to find comprehensive info — I'm not even sure why GCC can emit PIC while they are supposed to have predetermined load addresses. So for all I know, the original motivation for GOT-indirect mcount invocations is lost to history, and we can try to change it now (e.g. just use PLT or GOT based on -fno-plt like you propose).