[patch] MIPS: Fix synthesized doubleword transfers (ping)

Maciej W. Rozycki macro@linux-mips.org
Sat Feb 26 00:02:00 GMT 2005


On Thu, 24 Feb 2005, Richard Sandiford wrote:

> What I meant by the quote above was: suppose we have:
> 
>         ld <reg>,sym + offset
> 
> on a 32-bit target and:
> 
>         sym = 0x....4
>         offset = 0x....4
> 
> sym + offset is aligned, but the individual values aren't.  That might
> or might not be interpreted as satisfying any hypothetical "32-bit lds
> must be to aligned addresses" requirement.
> 
> It's an assembler interface thing really.  Does the assembler require
> the macros to use aligned addresses?  If so, does it require any symbol
> part to be aligned too?  (Obviously the individual "lw"s don't care
> about doubleword alignment, but that wasn't the point.)

 For whatever reason you may have e.g: sym = 0x87654321 and offset = 
0x7fff.  It's valid for a dword transfer, because the effective address is 
aligned.

> ...if we want to support unaligned accesses, fair enough.
> I guess the user can always use explicit relocs if they
> know the address is aligned.

 A user shouldn't use these macros in the first place, but if he does, 
then they should still produce valid code.  Therefore I'd prefer 
correctness over performance and code size.

 What about the other patch?  It's not the same issue, despite looking 
close.

  Maciej



More information about the Binutils mailing list