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: PATCH: w64 native support


"H. J. Lu" <hjl@lucon.org> wrote on 11.04.2007 15:58:37:

> On Wed, Apr 11, 2007 at 03:42:31PM +0200, Kai Tietz wrote:
> > Hello,
> > 
> > I did the windres.h patch changing the long to int types, so that 
problem 
> > #2737 seems to be solved.
> 
> No, it doesn't work on big endian host. You should array of char
> in external data structures.

Ok, I take a look for big-endian hosts and the external data structures.

> > Additionally I introduced in bfd-in.h the type "bfd_hostptr_t" and its 

> > hexadeicmal printf representation in macro "BFD_HOSTPTR_T_PRT_X". For 
now, 
> > AFAIS, only WIN64 has a long type lesser than a pointer, therefore I 
made 
> > the define dependent on the definiton of _WIN64. The modification in 
> 
> I don't believe we need BFD_HOSTPTR_T_PRT_X. As I said before, the
> PE problem is there is no clear line between external and internal
> data structues.  You should be able to use long long, even in big
> endian, internally to hold any PE data type. You just need to convert
> it to the proper size in proper endian when you write it out. You
> shouldn't have any problem when it is done peoperly.

The "long long" would work, if there would not be the -Werror parameter 
for gcc. The gcc bubbles a warning also for the case, that the integer 
casted to/from a pointer is bigger :(. This would break an cross from 
32-bit to 64-bit.
The helper macro BFD_HOSTPTR_T_PTR_X is for sure not coercively, but 
simplivies the readability AFAICS. 

Regards,
 i.A. Kai Tietz

------------------------------------------------------------------------------------------
  OneVision Software Entwicklungs GmbH & Co. KG
  Dr.-Leo-Ritter-StraÃe 9 - 93049 Regensburg
  Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
  Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
  Handelsregister: HRA 6744, Amtsgericht Regensburg
  KomplementÃrin: OneVision Software Entwicklungs Verwaltungs GmbH
  Dr.-Leo-Ritter-StraÃe 9 â 93049 Regensburg
  Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÃftsfÃhrer: 
Ulrike DÃhler, Manuela Kluger



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