This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
As can assemble of mips gp-relative code?
- To: binutils at sourceware dot cygnus dot com
- Subject: As can assemble of mips gp-relative code?
- From: David Foulds <dfoulds at cosinecom dot com>
- Date: Wed, 20 Oct 1999 13:55:39 -0700
I'm trying to port to gas some mips assembly code
which looks like this
sw a0, %sdaoff(cpu_type)($gp)
I decided the equivalent in gas syntax
was
sw a0, cpu_type(gp)
(cpu_type is an integer that is allocated to the .sbss
section by ld).
However, the relocatable code that is emitted by gas (10/20
snapshot) is
addu at,gp,gp
sw a0,0(at)
with cpu_type R_MIPS_GPREL16.
The linker does correctly calculate the offset
of cpu_type from _gp but the value in at is not _gp!
Also, two instructions are used here when one would
do, and at is stepped on.
Any comments? How can I get gas to do what I want,
which is to emit
sw a0,0(gp) with cpu_type R_MIPS_GPREL16?