This is the mail archive of the 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: PATCH: Updated version of x86_64-pc-mingw32 support of gcc.

Michael Matz <> wrote on 19.03.2007 17:34:18:

> > Reasoned by the RVA relocation, which is 64-bit, it is necessary for 
> > sure. As rev. see the msvcrt.dll, where it's base loading address is 
> > placed.
> Hmm, I've forgotten most about PE, so you might be right.  But as you 
> PC relative addressing the difference between %rip and any data from the 

> same module is never larger than 2GB --> small model is enough.  If you 
> can encode addresses of module X directly in .text of module Y, only 
> you need the large model.  You generally really really want to avoid 
> it, e.g. by indirecting over a pointer holding that 64bit address, but 
> placed in .data (or GOT in ELF), and loading from it, instead of 
> that 64bit address directly into .text.

for more information. If gcc would produce rip code (really position 
idepent code), than may the relocation issue could be ignored. But gcc 
doesn't do that, eg. for string-constants on passing them to functions as 
e.g. printf. An absolute reference is getting produced by pushing its 
address, which leads for PE to an RVA relocation.

i.A. Kai Tietz

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