This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]