From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Foulds To: binutils@sourceware.cygnus.com Subject: As can assemble of mips gp-relative code? Date: Wed, 20 Oct 1999 13:56:00 -0000 Message-id: <380E2C4B.5B010B29@cosinecom.com> X-SW-Source: 1999-10/msg00114.html 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?