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

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


> On Tue, Dec 05, 2006 at 04:26:02PM +0000, Nick Clifton wrote:
> >   OK, What do we think of this revised version of Michael's patch ?
> 
> An alternative is to never use sizeof(external_interface_struct).
> coff/external.h defines AOUTHDRSZ et al for exactly this reason.
>
No, this is actually not a valid alternative. coff/external.h defines the sizes
for all the structs, but this is actually the root of all evil:

The problems I found were caused by the memset call in line 499 of
bfd/coffswap.h. Thereby not only 18 (==AUXESZ) bytes starting from the given
pointer were overwritten, but rather the 2 bytes before as well, probably to
some alignment performed in between.

Cheers,
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/bedaabd0/attachment.sig>


More information about the Binutils mailing list