public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* why does -fno-pic coge generation on x64 require the large model?
@ 2011-11-07 11:39 Eli Bendersky
  2011-11-07 15:37 ` Ian Lance Taylor
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Bendersky @ 2011-11-07 11:39 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-11-08  6:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-07 11:39 why does -fno-pic coge generation on x64 require the large model? Eli Bendersky
2011-11-07 15:37 ` Ian Lance Taylor
2011-11-07 15:57   ` Eli Bendersky
2011-11-07 17:17     ` Andrew Haley
2011-11-07 18:12     ` Ian Lance Taylor
2011-11-08  3:19       ` Eli Bendersky
2011-11-08  5:49         ` Ian Lance Taylor
2011-11-08  6:09           ` Eli Bendersky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).