This is the mail archive of the binutils@sources.redhat.com 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]

Re: ld 2.11: unaligned memory access for unions


Nick Clifton <nickc@cambridge.redhat.com> writes:

> Ah OK I understand now.  The code is deliberately casting a void *
> pointer into a structure pointer, something which strictly speaking it
> should not do, since GCC then (reasonably) assumes that the pointer is
> aligned as required for the structure type.

I don't understand.

The external structure has only char[] fields, so gcc should not make
any alignment assumptions.

The internal structure should be aligned appropriately any place where
BFD uses it.  If it is not, where is it being used?  Why is it not
aligned?

Ian


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