This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gas question: PowerPC section relative addressing
- From: Rob Ballantyne <ballanty at cecm dot sfu dot ca>
- To: binutils at sources dot redhat dot com
- Date: Sun, 10 Mar 2002 18:04:36 -0800
- Subject: gas question: PowerPC section relative addressing
Hello All,
I'm sure I'm missing something very obvious but I can't find
it anywhere.
I would like to be able to set a particular register to be
the base of a section, say r2, so that I can access data within
that section. Something like:
lis r2,data@ha
addi r2,0,data@l
lwz r14,fred(r2)
data: .data
somedata: .int 0
somemore: .int 0
fred: .int 1234
So far I haven't found the necessary trick but I have
managed to see that something like:
lis r2,data@ha
addi r2,0,data@l
lwz r14,(fred-data)(r2)
data: .data
somedata: .int 0
somemore: .int 0
fred: .int 1234
does work but is ackward.
Is there a better way to do section relative addressing?
Thanks,
Rob