[patch] coff: fix alignment issues when building on ARM

Michael Tautschnig tautschn@model.in.tum.de
Tue Dec 5 21:33:00 GMT 2006


> 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20061205/d8dede6e/attachment.sig>


More information about the Binutils mailing list