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] coff: fix alignment issues when building on ARM


> Hi Guys,
> 
>   OK, What do we think of this revised version of Michael's patch ?
> 
>   I took the liberty of defining ATTRIBUTE_PACKED in ansidecl.h since 
> it looks like this attribute might be need in more places in the future. 
>  I did not add a gcc version test for this since I could not find out 
> when the packed attribute was introduced.  (I think that it came in when 
> attributes came in, but I am not sure).
>

Sorry for responding that late, I've been a bit busy today.

Just a few comments: 
The use of __attribute__((packed)) seems to be the least intrusive as it should
neither break the existing code nor would it cause trouble when working on
binaries that were created before, unless running on old-ABI ARM, but these
binaries were corrupted anyway.

On the other hand, this is rather a hack than a real fix as it may cause
problems with compilers other than gcc. However, a proper fix would require a
change of the size of the structures, which would definitely cause trouble
whenever the binutils version used for building the file does not match that one
for working on the binary later on.

Best,
Michael


Attachment: pgp00000.pgp
Description: PGP signature


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