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

--- Comment #27 from Thiago Macieira <thiago at kde dot org> ---
(In reply to Jakub Jelinek from comment #26)
> Plus, if KDE uses so small binaries, why don't just compile them with -fPIC
> then?
> You can then link them as normal executables or PIEs, depending on what you
> prefer, and still it supposedly wouldn't use copy relocations, as all
> references to externals would be through .got.

Can you guarantee that the linker won't generate copy relocs for -fPIC?

Anyway, I know I am generalising from a sample of 1, but in my experience as a
desktop developer, the mass of library code is much bigger and more complex
than the application code. This is probably not true in large single-instance
applications -- for example, mysqld's text segment is of comparable size to the
total size of the libraries it uses.

Still, if this were solved properly, relocations that resolved back into the
executable itself would still be bound locally, even position-dependently if
that's how the binary were built. I am asking that it stop doing copy
relocations, which only applies to symbols the linker *did* detect came from
elsewhere.

I've also said I'll gladly tag each of those symbols with an __attribute__ so
that GCC also knows it comes from elsewhere and generate the proper indirect
load sequence via the GOT.

Reply via email to