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


On Wed, Dec 06, 2006 at 12:47:52AM +0100, Michael Tautschnig wrote:
> 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.

That's nasty.  It seems we are using a construct with undefined
behaviour.  So yes, we need that attribute packed patch.

6.3.2.3 Pointers
7 A pointer to an object or incomplete type may be converted to a
pointer to a different object or incomplete type. If the resulting
pointer is not correctly aligned for the pointed-to type, the behavior
is undefined. ...

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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