difference between 32 bit and 64 bit .so
Alan Modra
amodra@gmail.com
Fri Jul 23 05:59:00 GMT 2010
On Fri, Jul 23, 2010 at 12:59:55AM -0400, MK wrote:
> I recently saw that while building a .so dynamic library on 32 bit
> linux machines (Intel processor), it is ok if you omit the -fpic flag.
This is not true. Some features of ELF shared libraries will not work
properly if you compile without -fpic or -fPIC, even on 32-bit x86.
> I am wondering why this stops working on 64 bit machines?
You'd sacrifice speed in executables if the compiler was forced to
generate code that could be used in shared libs.
It would be better to wonder why we still support non-PIC libraries on
32-bit x86.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list