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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux