This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
why does -fno-pic coge generation on x64 require the large model?
- From: Eli Bendersky <eliben at gmail dot com>
- To: gcc-help at gnu dot org
- Date: Mon, 7 Nov 2011 13:39:05 +0200
- Subject: why does -fno-pic coge generation on x64 require the large model?
Hello,
I'm experimenting with generating PIC and non-PIC code on x64 Ubuntu.
It's possible to generate non PIC code as follows:
gcc -fno-PIC -mcmodel=large -shared -c file.c
However, I noticed that for other models (i.e. -mcmodel=small, or by
default, without the -mcmodel argument), the code being generated is
not really suitable for PIC as it has problematic load-time
relocations.
My question is - why is the large model required to generate true PIC code?
Thanks in advance,
Eli