* ld-2.12.1, PowerPC
@ 2002-10-11 2:50 Etienne Lorrain
2002-10-11 3:23 ` Alan Modra
0 siblings, 1 reply; 3+ messages in thread
From: Etienne Lorrain @ 2002-10-11 2:50 UTC (permalink / raw)
To: binutils
Hello,
----------------------
$ local/bin/xas --version
GNU assembler 2.12.1
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `powerpc-eabi'.
Administrator@NDSUK4908 ~
$ local/bin/xas -m603 -al -o a.o
li %r0,0
a_label:
subi %r3,%r3,a_label@l
GAS LISTING page 1
1 0000 38000000 li %r0,0
2 a_label:
3 0004 38630000 subi %r3,%r3,a_label@l
Administrator@NDSUK4908 ~
$ local/bin/xld a.o
local/bin/xld: warning: cannot find entry symbol _start; defaulting to
01800074
Administrator@NDSUK4908 ~
$ local/bin/xobjdump -D a.out
a.out: file format elf32-powerpc
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
Disassembly of section .sdata2:
Disassembly of section .data:
Disassembly of section .sdata:
----------------------
Everything is right, but why the subi has been changed by xld to addi ?
It could have been "addi r3,r3,0xFF88", but it is not (-120 = 0xFF88).
Please say me I did not wake up this morning...
Thanks,
Etienne.
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ld-2.12.1, PowerPC
2002-10-11 2:50 ld-2.12.1, PowerPC Etienne Lorrain
@ 2002-10-11 3:23 ` Alan Modra
2002-10-11 3:47 ` Etienne Lorrain
0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2002-10-11 3:23 UTC (permalink / raw)
To: Etienne Lorrain; +Cc: binutils
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ld-2.12.1, PowerPC
2002-10-11 3:23 ` Alan Modra
@ 2002-10-11 3:47 ` Etienne Lorrain
0 siblings, 0 replies; 3+ messages in thread
From: Etienne Lorrain @ 2002-10-11 3:47 UTC (permalink / raw)
To: Alan Modra; +Cc: binutils
--- Alan Modra <amodra@bigpond.net.au> a écrit :
> On Fri, Oct 11, 2002 at 11:50:30AM +0200, Etienne Lorrain wrote:
> > 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.
An error message in gas would be a good solution.
Etienne.
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-10-11 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11 2:50 ld-2.12.1, PowerPC Etienne Lorrain
2002-10-11 3:23 ` Alan Modra
2002-10-11 3:47 ` Etienne Lorrain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).