The absence of a arm-thumb interworking libgcc.a
Rimpei Sosa
sosa.rimpei@jp.panasonic.com
Wed Jun 4 03:27:00 GMT 2003
It seems that there is neither arm-interworking libgcc.a nor
thumb-interworking libgcc.a in gcc3.2.
In order to generate arm interworking libgcc.a and thumb interworking
libgcc.a, what should I do?
--
As an example, here are two programs:
main.c for main function using arm instructions set.
foo.c for sub function called by main using thumb instructions set.
$ cat main.c
int foo(int,int);
int main(void){
return foo(9,4);
}
$cat foo.c
int foo(int i,int j){
return (i/j);
}
after compiling them with :
$ arm-linux-gcc -c -mthumb-interwork main.c
$ arm-linux-gcc -c -mthumb -mthumb-interwork foo.c
I got an error message shown below from ld when linking with
the devision routine in libgcc.a.
$ arm_v4t_le-gcc -mthumb-interwork main.o foo.o
/tools/lib/gcc-lib/arm-linux/3.2/../../../../arm-linux/bin/ld: Warning: /tools/l
ib/gcc-lib/arm-linux/3.2/libgcc.a(_divsi3.o) does not support interworking, wher
eas a.out does
/tools/lib/gcc-lib/arm-linux/3.2/../../../../arm-linux/bin/ld: Warning: /tools/l
ib/gcc-lib/arm-linux/3.2/libgcc.a(_dvmd_lnx.o) does not support interworking, wh
ereas a.out does
/tools/lib/gcc-lib/arm-linux/3.2/../../../../arm-linux/bin/ld: Warning: /tools/l
ib/gcc-lib/arm-linux/3.2/crtend.o does not support interworking, whereas a.out d
oes
/tools/lib/gcc-lib/arm-linux/3.2/../../../../arm-linux/bin/ld: Warning: /tools/l
ib/gcc-lib/arm-linux/3.2/../../../../arm-linux/lib/crtn.o does not support inter
working, whereas a.out does
/tools/lib/gcc-lib/arm-linux/3.2/../../../../arm-linux/bin/ld: /tools/lib/gcc-li
b/arm-linux/3.2/libgcc.a(_divsi3.o)(__divsi3): warning: interworking not enabled
.
/tools/lib/gcc-lib/arm-linux/3.2/../../../../arm-linux/bin/ld: first occurrenc
e: foo.o: thumb call to arm
foo.o: In function `foo':
foo.o(.text+0x1a): internal error: dangerous error
I guess if I can get libgcc.a compiled with -mthumb-interwork or
-mthumb -mthumb-interwork , it all should work out.
Then, I have a look at ~/rpm/BUILD/gcc-3.2/gcc/config/arm/t-arm-elf
and find these three lines are already uncommented:
MULTILIB_OPTIONS = marm/mthumb
MULTILIB_DIRNAMES = arm thumb
MULTILIB_EXCEPTIONS =
which means interworking libgcc.a is supporsed to exist.
Any advice would be appreciated,
Rimpei Sosa.
More information about the Gcc
mailing list