This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Is it possible to make the whole image above 4G on a 64 bit machine?


On Wed, Aug 29, 2012 at 08:37:13PM -0700, H.J. Lu wrote:
> On Wed, Aug 29, 2012 at 7:18 PM, ééä (Wei-Ren Chen)
> <chenwj@iis.sinica.edu.tw> wrote:
> > Hi H.J.,
> >
> >> >   If it's possible to make the whole image above 4G, how I can do that?
> >> > If not, could you explain why? Thanks.
> >> >
> >>
> >> You must use PIE to place an executable above 4G.
> >
> >   Thanks for your tip, it works! I did following,
> >
> > $ gcc -Wl,-Ttext-segment=0x80000000 -fPIE -pie test.c -o test
> >
> > But why the linker gave me those errors? Although I know pie makes program
> > position independent, so that it can be loaded at any address space, I don't
> > know why linker complains, does it find something wrong while linking against
> > those libraries (I see the errors, but don't understanding it...)? Would
> > you like to shed some light on it? Thanks. :-)
> >
> 
> This is the limitation of the small model.  The large model should work
> if you have all libraries compiled for the large model.

  I guess you mean "-mcmodel" option in GCC, right? So when I compile a
program without options "-fPIE" and "-pie", the libraries it link against
are compiled with "-mcmodel=small", and they are only allow to reside in
memory below 2G space. That's why I saw those errors, am I right?

  Thanks.

Regards,
chenwj

-- 
Wei-Ren Chen (ééä)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj


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