This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
powerpc assembler: STW and .sdata variables
- From: Jeff Lasslett <jeff dot lasslett at datataker dot com dot au>
- To: binutils at sourceware dot org
- Date: Thu, 14 Sep 2006 12:23:23 +1000
- Subject: powerpc assembler: STW and .sdata variables
Hello,
The Diab assembler that I am replacing with GNU as supports the following:-
stw r3,Trace@sdarx(r13)
All it's doing is storing the contents of r3 into the variable 'Trace' which
happens to be in the .sdata section.
Is there a GNU equivalent to the diab syntax above?
'Trace' is a variable declared in section .sdata.
'@sdarx' is described as follows in the Diab assembler manual:-
expr@sdarx The 16 bit offset of expr from the SDA base register
is calculated. The produced relocation will cause the
linker to modify the destination register field in the
instruction.
If I understand the EABI correctly then r13 should hold the base address of
the .sdata section.
Do I have to do something like:
lis r10,Trace@ha
stw r3,Trace@l(r10)
Or is there some syntax that makes use of the fact that a register (r13) has
the .sdata address in it already?
Thanks,
Jeff