Rimpei Sosa
2003-06-05 01:49:37 UTC
It seems that my glibc doesn't provide any arm-thumb interworking support.
What I'd like to achieve here is to call glibc's functions from thumb code.
How can I produce an arm-thumb interworking glibc?
Any advice would be appreciated,
Rimpei Sosa.
------
Here is an example:
main.c for main function using arm instructions set.
foo.c for sub function called by main using thumb instructions set.
$ cat main.c
void foo(void);
int main(void){
foo();
return ;
}
$cat foo.c
#include <stdio.h>
void foo(void){
printf("HelloWorld\n");
return ;
}
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 glibc.
$ arm-linux-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/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: foo.o: unable to
find THUMB glue '__printf@@GLIBC_2.0_from_thumb' for `printf@@GLIBC_2.0'
foo.o: In function `foo':
foo.o(.text+0x8): internal error: dangerous error
-------------------------------------------------------------------------------
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
What I'd like to achieve here is to call glibc's functions from thumb code.
How can I produce an arm-thumb interworking glibc?
Any advice would be appreciated,
Rimpei Sosa.
------
Here is an example:
main.c for main function using arm instructions set.
foo.c for sub function called by main using thumb instructions set.
$ cat main.c
void foo(void);
int main(void){
foo();
return ;
}
$cat foo.c
#include <stdio.h>
void foo(void){
printf("HelloWorld\n");
return ;
}
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 glibc.
$ arm-linux-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/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: foo.o: unable to
find THUMB glue '__printf@@GLIBC_2.0_from_thumb' for `printf@@GLIBC_2.0'
foo.o: In function `foo':
foo.o(.text+0x8): internal error: dangerous error
-------------------------------------------------------------------------------
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php