This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/2] MIPS/GAS: Fix o32 LD to the base register
On Mon, 18 Oct 2010, Richard Sandiford wrote:
> > Disassembly of section .text:
> >
> > 00000000 <.text>:
> > 0: 00800821 move at,a0
> > 4: 8c240000 lw a0,0(at)
> > 8: 8c250004 lw a1,4(at)
>
> Why are you doing it this way, rather than reversing the loads?
Because I've got a hole in my imagination here? :/
> Seems a shame to use $at when we don't need to.
Indeed, although we're no better elsewhere, consider e.g.:
$ cat ld-base-1.s
.comm foo, 1024
ld $4, foo
$ as -32 -o ld-base-1.o ld-base-1.s
$ objdump -dr ld-base-1.o
ld-base-1.o: file format elf32-tradbigmips
Disassembly of section .text:
00000000 <.text>:
0: 3c010000 lui at,0x0
0: R_MIPS_HI16 foo
4: 8c240000 lw a0,0(at)
4: R_MIPS_LO16 foo
8: 8c250004 lw a1,4(at)
8: R_MIPS_LO16 foo
c: 00000000 nop
where $a1 could be used in place of $at, couldn't it?
I'll cook up something, though I only have worms to offer it would seem.
Maciej