This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld-2.12.1, PowerPC
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Etienne Lorrain <etienne_lorrain at yahoo dot fr>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 11 Oct 2002 19:53:55 +0930
- Subject: Re: ld-2.12.1, PowerPC
- References: <20021011095031.80426.qmail@web11802.mail.yahoo.com>
On Fri, Oct 11, 2002 at 11:50:30AM +0200, Etienne Lorrain wrote:
> $ local/bin/xas -m603 -al -o a.o
> li %r0,0
> a_label:
> subi %r3,%r3,a_label@l
[snip]
> Disassembly of section .text:
>
> 01800074 <a_label-0x4>:
> 1800074: 38 00 00 00 li r0,0
>
> 01800078 <a_label>:
> 1800078: 38 63 00 78 addi r3,r3,120
> ----------------------
>
> Everything is right, but why the subi has been changed by xld to addi ?
Well, there isn't a powerpc subi instruction at the machine level.
subi is really a macro, with "subi Rx,Ry,value" equivalent to
"addi Rx,Ry,-value".
> It could have been "addi r3,r3,0xFF88", but it is not (-120 = 0xFF88).
gas should have rejected your source, as it's not possible in
general to use the negative of a (non-absolute) label.
--
Alan Modra
IBM OzLabs - Linux Technology Centre