This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why does -fno-pic coge generation on x64 require the large model?


On 11/07/2011 03:56 PM, Eli Bendersky wrote:
> I should also add that my intention here is just curiosity. I was
> trying to understand how PIC code works on x64, and got intrigued by
> the fact that GCC seemingly forces me to use PIC code for shared
> libraries on this architecture, unlike x86 where non-PIC code in
> shared libraries is fine.

The x86 shared library loader has a kludge where pages that contain
non-PIC code are remapped and relocated, so every process ends up with
its own copy of each relocated page.  This is provided for
compatibility with older libraries.  x86_64 is a new architecture, so
it wasn't necessary to provide backwards compatibility for non-PIC
libraries.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]