Question related to -fPIC behaviour across architectures

Florian Weimer fweimer@redhat.com
Tue May 3 14:29:58 GMT 2022


* vincent Dupaquis:

> - Did I miss anything ?

The linker can perform relaxations (e.g., elimination of GOT
indirection) based on whole-program analysis, something the compiler
cannot do.  Such optimizations are very much target-dependent, and they
often need some previous ABI work to define new relaxable relocations
for relocatable object files.

> - Is there somewhere a common definition of what mean PIC for the
>   different architectures ?

Not really, not even for ELF.  There are some common assumptions in the
background for ELF implementations (e.g., one canonical function
address), but how you get there varies somewhat.

Thanks,
Florian



More information about the Gcc-help mailing list