powerpc-linux-as rejects legitimate addressing. (OK with .equ)
Erik Christiansen
erik@dd.nec.com.au
Thu Mar 27 06:36:00 GMT 2003
Where is the problem:
---------------------
$ powerpc-linux-as --version
GNU assembler 2.13.90.0.4 20020814
What is the problem:
--------------------
$ powerpc-linux-as -mregnames -o gas_test.o gas_test.s
gas_test.s: Assembler messages:
gas_test.s:11: Error: unsupported relocation against bargraph
file: gas_test.s
========================================================================
.align 2
.=0x0130 # A)
bargraph: # This should work, but as complains.
.skip 4 #
# B)
# .equ bargraph , 0x130 # Assembles & runs OK, using this instead.
bump_bargraph:
lbz r7,bargraph(0) # Likes B), but not A).
========================================================================
What is expected:
-----------------
$ powerpc-linux-objdump -D gas_test.o
========================================================================
gas_test.o: file format elf32-powerpc
Disassembly of section .text:
00000000 <bump_bargraph>:
0: 88 e0 01 30 lbz r7,304(r0)
Disassembly of section .data:
========================================================================
(This is what case B gives.)
Why it is a problem:
--------------------
Accessing the top and bottom 32k of memory like this is documented
and kosher. Resorting to a .equ to help the assembler correctly
address a fixed point in memory is an error prone hack.
Tried the crossgcc mailing list & archives, but no joy. It look a lot
like a bug, but is it?
Regards,
Erik
More information about the Gcc-bugs
mailing list