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: PIC is wasteful


On 06/23/2011 02:35 PM, Agner Fog wrote:

> It is possible to put absolute addresses into a .so and it works. I 
> tried this in Ubuntu, and it works with 32 bit absolute addresses in a 
> 32 bit .so, and with 64 bit absolute addresses in a 64 bit .so. The only 
> thing that doesn't work is 32 bit absolute addresses in a 64 bit so. In 
> many cases, this is faster than making PIC. I guess this was implemented 
> for the sake of virtual tables, jump tables, etc. My question is: Does 
> this work in all versions of Linux, BSD, MacOS? Which platforms or 
> versions do not allow absolute addresses in shared objects?

I don't understand how an absolute address can ever do anything useful
in a shared object.  By definition, you don't know where that shared
object will be loaded.  Can you provide an example of a 64-bit
absolute address in a 64-bit shared object?

Andrew.


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