why does -fno-pic coge generation on x64 require the large model?
Ian Lance Taylor
iant@google.com
Mon Nov 7 18:12:00 GMT 2011
Eli Bendersky <eliben@gmail.com> writes:
> What I'm trying to see is how to convince GCC to generate NON-PIC code
> and link it into a shared library for x64. I only managed to do this
> with "-fno-PIC -mcmodel=large", and I wonder why with other memory
> models it doesn't work out. I suspect this has to do with some
> artifact of x64's addressing modes for symbol offsets.
Yes. If it were easy to permit non-PIC x86_64 code in a shared library,
gcc would do it. But the only way to do that is, as you say, to use the
large memory model, which is relatively inefficient.
Ian
More information about the Gcc-help
mailing list