4 messages in com.googlegroups.android-internalsRe: [android-internals] Re: Staticall...
FromSent OnAttachments
Diluka Moratuwage28 Jan 2008 07:03 
Diluka Moratuwage29 Jan 2008 08:16 
gavin fang29 Jan 2008 08:20 
Diluka Moratuwage29 Jan 2008 09:01 
Subject:Re: [android-internals] Re: Statically linking for Android
From:gavin fang (good@gmail.com)
Date:01/29/2008 08:20:21 AM
List:com.googlegroups.android-internals

On Jan 30, 2008 12:16 AM, Diluka Moratuwage <dil@wso2.com> wrote:

Oooops!!!!!!!!!!!!! This is a mistake. I got through the problem, it can be linked statically nicely.

would you share what's the problem?

Thanks, Diluka.

Hi all,

Do you have some idea of this statically linking in android ?

I tried the statically linking thing, and seems it raise a relocation problem. Can you please give me a suggestion if you have some idea of it. I used the following commands to build the library.

arm-none-linux-gnueabi-gcc -c android_util.c arm-none-linux-gnueabi-gcc -fPIC -shared -static -Wl,-soname,libandroid.so.0.0,-T,armelf_linux_eabi.xsc -T armelf_linux_eabi.xsc -o libandroid.so android_util.o

In here I'm trying to link the C library statically into a source file, following is the output I get;

/home/diluka/projects/softwares/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: /home/diluka/projects/softwares/arm-2007q3/bin/../arm-none-linux-gnueabi/libc/usr/lib/libc.a(dl-tsd.o)(.text+0x14): R_ARM_TLS_LE32 relocation not permitted in shared object

When I tried to link it to a program and try to run it in the emulator it claims that;

# ./test WARNING: `libandroid.so.0.0` is not a prelinked library ERROR: 549 unknown reloc type 3 @ 0x800101d0 (3350) ERROR: failed to link libandroid.so.0.0 ERROR: 549 could not load 'libandroid.so.0.0' ERROR: failed to link ./test ERROR: CANNOT LINK EXECUTABLE './test'

Any ideas I highly appreciate. Have I done sth wrong ?

Thank you.

Thanks, Diluka.