This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld 2.11: unaligned memory access for unions
- To: ian at zembu dot com
- Subject: Re: ld 2.11: unaligned memory access for unions
- From: Eberhard Mattes <mattes at azu dot informatik dot uni-stuttgart dot de>
- Date: Thu, 21 Jun 2001 12:00:56 +0200 (MET DST)
- CC: nickc at cambridge dot redhat dot com, binutils at sources dot redhat dot com
> I agree that the void * pointer needs to satisfy the alignment
> requirements of the struct, but I don't agree that the void * pointer
> needs to satisfy any more strict alignment requirements.
True. There's something strange going on: SYMENT's alignment is 1
(it's just a collection of char[]), so one of the two pointers passed
to memcpy doesn't have any alignment requirements, and memcpy() must
not copy word-by-word, even if the other pointer has strict enough
alignment requirements. When I wrote the bug report, I looked at the
assembly code and it used ldr/str (not ldrb/strb) instructions, so the
problem did exist. Anyway, I cannot recreate the problem. For now,
just consider the problem to not exist, I'll let you know when it
reappers.
Eberhard