This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
powerpc-eabi and -msdata
- To: binutils at sourceware dot cygnus dot com
- Subject: powerpc-eabi and -msdata
- From: jtc at redback dot com (J.T. Conklin)
- Date: 15 Jun 2001 09:33:13 -0700
- Reply-To: jtc at redback dot com
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