powerpc-eabi and -msdata

J.T. Conklin jtc@redback.com
Fri Jun 15 09:33:00 GMT 2001


We have a 8240 firmware driver.  It does a lot of accesses to a small
chunk of global data, so I'd like to use gcc's -msdata option so that
such accesses use r2/r13 relative rather than absolute addressing.

It was easy enough to do add the -msdata option, but now I get link
failures from the linker-script symbols I use to clear the bss section.


powerpc-eabi-ld-19991012: /var/tmp/jtc/obj/mainline-link/more/fe/obj/fwtx8240/fabric.o: The target (end) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (*ABS*)
powerpc-eabi-ld-19991012: /var/tmp/jtc/obj/mainline-link/more/fe/obj/fwtx8240/fabric.o: The target (__bss_start) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (.bss)
powerpc-eabi-ld-19991012: /var/tmp/jtc/obj/mainline-link/more/fe/obj/fwtx8240/fabric.o: The target (end) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (*ABS*)
powerpc-eabi-ld-19991012: /var/tmp/jtc/obj/mainline-link/more/fe/obj/fwtx8240/fabric.o: The target (end) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (*ABS*)
powerpc-eabi-ld-19991012: final link failed: Bad value


I suspect that, because "__bss_start" and "end" are declared as small
globals, gcc assumes that they will be located in the sdata/sbss or
sdata2/sbss2 sections.  The link fails because they are not.

What's the best way to solve this?  The reason I access __bss_start
and end is for clearing bss in C.  I guess I could move this to my
startup code without too much trouble.

Many thanks,

        --jtc

-- 
J.T. Conklin
RedBack Networks



More information about the Binutils mailing list