This is the mail archive of the gcc@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: x86-64 and large code model questions/bugs


On Wed, Jan 28, 2009 at 10:21:16AM +0100, Paolo Bonzini wrote:
> Andi Kleen wrote:
> > On Wed, Jan 28, 2009 at 09:39:39AM +0100, Paolo Bonzini wrote:
> >>> He'll get much better code by putting the program into a -fPIC .so,
> >>> loading it from a small stub and then unmap the stub.
> >>> large model generates really very bad code because all jumps
> >>> will be indirect.
> >> Is it also true with -fpie?
> > 
> > Not sure what you mean?
> 
> Right, sorry.  I meant "can you also use -fpie and use a linker script
> to relocate the text section", if you want to place it high but the code
> is not gigantic?

That would require -fpie crt*

Probably doable, but needs some more effort than just 
using a classical main() stub.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.


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