Path for .so to get linked against executable for target

by Girish » Wed, 18 Mar 2009 04:35:49 GMT


Sponsored Links
 I am trying to build a exe using shared objects generated on android
platfrom. I am able to build them without compile time linking errors
but when i try to execute them li gives me linker problem. in which
path i need to place the shared object to get them linked against
executable on the hardware target ?

Here is the error message

bionic/linker/linker.c:1078| ERROR:  3639 cannot locate '(null)'...
bionic/linker/linker.c:1579| ERROR: failed to link libtest1.so
bionic/linker/linker.c:1519| ERROR:  3639 could not load 'libtest1.so'
bionic/linker/linker.c:1579| ERROR: failed to link ./libtest
bionic/linker/linker.c:1677| ERROR: CANNOT LINK EXECUTABLE './libtest'
#



Make file goes here

LOCAL_PATH := $(call my-dir)
MY_LOCAL_PATH := $(LOCAL_PATH)
include $(CLEAR_VARS)

LOCAL_PREBUILT_LIBS := libtest1.so libtest2.so libtest3.so \

include $(BUILD_MULTI_PREBUILT)

LOCAL_PATH := $(MY_LOCAL_PATH)
include $(CLEAR_VARS)

LOCAL_SRC_FILES :=  \
                                main.c \
                                test.c \

LOCAL_C_INCLUDES += \
                                        $(MY_LOCAL_PATH) \

LOCAL_MODULE := libtest

LOCAL_SHARED_LIBRARIES +=  libtest1 libtest2 libtest3

LOCAL_LDLIBS := -lrt -lpthread

include $(BUILD_EXECUTABLE)

Can any one help ?

Regards
Girish
--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Girish » Wed, 18 Mar 2009 04:47:19 GMT


 To give some more info

I tried following

1)placed the .exe in /data and libs in /system/lib
2)placed the .exe in and libs bothin /data

Changed mode of exe to give executable permissions.

Is there some thing else i need to do ? please clarify

Regards
Girish
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Path for .so to get linked against executable for target

by Iliyan Malchev » Wed, 18 Mar 2009 04:59:43 GMT


 This looks like a bug which is fixed in cupcake, where we were not
properly ignoring R_ARM_NONE relocations.  Can you run
arm-eabi-readelf -a libtest1.so and take a look at the relocations?
Is there an R_ARM_NONE?




--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Girish » Wed, 18 Mar 2009 05:35:38 GMT


 Hi lliyan Malchev,

Thanks for the i/ps.I searched for R_ARM_NONE in the .so file using
command arm-eabi-readelf -a libtest1.so as told by you. But i DIDNOT
find R_ARM_NONE.

Although i found R_ARM_RELATIVE and R_ARM_JUMP_SLOT. Can you clarify
some more on this issue. and how to fix the same.

Regards
Girish


--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Iliyan Malchev » Wed, 18 Mar 2009 05:48:19 GMT


 Can you send me the binaries for the libraries in question?  It would
be easier to debug this issue this way.  If not, then please do the
following:

1. cd bionic/linker
2. edit linker_debug.h, setting the following macros to 1:

#define LINKER_DEBUG         1
#define TRACE_DEBUG          1

3. cd $TOP; make linker
4. adb remount && adb sync
5. rerun your test, as follows:

adb shell "DEBUG=3 libtest" | tee log.txt

and email me the file.

Thanks
Iliyan




--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by nagamatu » Wed, 18 Mar 2009 06:34:14 GMT


 When R_ARM_NONE symbol is included in a binary file, I got
the following error message from dynamic linker.

# /system/bin/test
bionic/linker/linker.c:1181| ERROR:  8435 unknown reloc type 0 @
0xa3b8 (19)
bionic/linker/linker.c:1579| ERROR: failed to link /system/bin/test
bionic/linker/linker.c:1677| ERROR: CANNOT LINK EXECUTABLE '/system/
bin/test'

This problem can be fixed with adding 2 line of code for dynamic
linker.

*** linker.c.org        2009-02-05 15:20:12.000000000 +0900
--- linker.c    2009-03-11 13:46:47.000000000 +0900
***************
*** 1174,1179 ****
--- 1174,1181 ----
                         reloc, s->st_size, sym_addr, sym_name);
              memcpy((void*)reloc, (void*)sym_addr, s->st_size);
              break;
+         case R_ARM_NONE: // just a marker. ignore this
+             break;
  #endif /* ANDROID_ARM_LINKER */

          default:





--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Iliyan Malchev » Wed, 18 Mar 2009 06:37:52 GMT


 That's already fixed on cupcake.

2009/3/17 nagamatu <nagam...@gmail.com>:



--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by nagamatu » Wed, 18 Mar 2009 07:09:33 GMT


 Dear Iliyan,

it's great. But I couldn't find R_ARM_NONE fix in the latest bionic
for cupcake branch on 2009/03/04.

 http://android.git.kernel.org/?p=platform/bionic.git ;a=blob_plain;f=linker/linker.c;hb=1dc9e472e19acfe6dc7f41e429236e7eef7ceda1

Regards,
nagamatu





--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Iliyan Malchev » Wed, 18 Mar 2009 07:27:22 GMT


 m, you are right!  Will fix :)  I was thinking about the prelinker,
which does handle R_ARM_NONE.

2009/3/18 nagamatu <nagam...@gmail.com>:

--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Girish » Wed, 18 Mar 2009 07:44:51 GMT


 i lliyan Malchev and nagamatu,

Can the latest cupcake code will give a fix for my problem or yet to
be fixed ? lliyan i sent the file to your e-mail id.

lliyan hope this fix will come soon. or u can send me the fix will
test and let you know the result

For a quick look pasting log here

[ android linker & debugger ]
DEBUG: 2967 elfdata @ 0xbec82d80
2967 name libtest: allocated soinfo @ 0xb00158d8
[ 2967 linking libtest ]
DEBUG: 2967 si->base = 0x00000000 si->flags = 0x00000004
DEBUG: 2967 PT_LOAD (phdr = 0x00008094)
DEBUG: phdr->offset = 0x00000000
DEBUG: phdr->p_vaddr = 0x00008000
DEBUG: phdr->p_paddr = 0x00008000
DEBUG: phdr->p_filesz = 0x0000cbb4
DEBUG: phdr->p_memsz = 0x0000cbb4
DEBUG: phdr->p_flags = 0x00000005
DEBUG: phdr->p_align = 0x00001000
DEBUG: 2967 PT_LOAD (phdr = 0x000080b4)
DEBUG: phdr->offset = 0x0000d000
DEBUG: phdr->p_vaddr = 0x00015000
DEBUG: phdr->p_paddr = 0x00015000
DEBUG: phdr->p_filesz = 0x00016792
DEBUG: phdr->p_memsz = 0x00016dc0
DEBUG: phdr->p_flags = 0x00000006
DEBUG: phdr->p_align = 0x00001000
DEBUG: 2967 PT_DYNAMIC (phdr = 0x000080d4)
DEBUG: phdr->offset = 0x00023650
DEBUG: phdr->p_vaddr = 0x0002b650
DEBUG: phdr->p_paddr = 0x0002b650
DEBUG: phdr->p_filesz = 0x000000f8
DEBUG: phdr->p_memsz = 0x000000f8
DEBUG: phdr->p_flags = 0x00000006
DEBUG: phdr->p_align = 0x00000004
DEBUG: 2967 dynamic = 0x2b650
DEBUG: 2967 d = 0x2b650, d[0] = 0x00000001 d[1] = 0x00000001
DEBUG: 2967 d = 0x2b658, d[0] = 0x00000001 d[1] = 0x00000010
DEBUG: 2967 d = 0x2b660, d[0] = 0x00000001 d[1] = 0x0000001e
DEBUG: 2967 d = 0x2b668, d[0] = 0x00000001 d[1] = 0x00000027
DEBUG: 2967 d = 0x2b670, d[0] = 0x00000001 d[1] = 0x0000002f
DEBUG: 2967 d = 0x2b678, d[0] = 0x00000001 d[1] = 0x0000003c
DEBUG: 2967 d = 0x2b680, d[0] = 0x00000020 d[1] = 0x00015000
DEBUG: 2967 libtest constructors (preinit_array) found at 0x15000
DEBUG: 2967 d = 0x2b688, d[0] = 0x00000021 d[1] = 0x00000008
DEBUG: 2967 d = 0x2b690, d[0] = 0x00000019 d[1] = 0x00015008
DEBUG: 2967 libtest constructors (init_array) found at 0x15008
DEBUG: 2967 d = 0x2b698, d[0] = 0x0000001b d[1] = 0x00000008
DEBUG: 2967 d = 0x2b6a0, d[0] = 0x0000001a d[1] = 0x00015010
DEBUG: 2967 libtest destructors (fini_array) found at 0x15010
DEBUG: 2967 d = 0x2b6a8, d[0] = 0x0000001c d[1] = 0x00000008
DEBUG: 2967 d = 0x2b6b0, d[0] = 0x00000004 d[1] = 0x00008108
DEBUG: 2967 d = 0x2b6b8, d[0] = 0x00000005 d[1] = 0x00008384
DEBUG: 2967 d = 0x2b6c0, d[0] = 0x00000006 d[1] = 0x000081c4
DEBUG: 2967 d = 0x2b6c8, d[0] = 0x0000000a d[1] = 0x000001aa
DEBUG: 2967 d = 0x2b6d0, d[0] = 0x0000000b d[1] = 0x00000010
DEBUG: 2967 d = 0x2b6d8, d[0] = 0x00000015 d[1] = 0x00000000
DEBUG: 2967 d = 0x2b6e0, d[0] = 0x00000003 d[1] = 0x0002b748
DEBUG: 2967 d = 0x2b6e8, d[0] = 0x00000002 d[1] = 0x00000070
DEBUG: 2967 d = 0x2b6f0, d[0] = 0x00000014 d[1] = 0x00000011
DEBUG: 2967 d = 0x2b6f8, d[0] = 0x00000017 d[1] = 0x00008538
DEBUG: 2967 d = 0x2b700, d[0] = 0x00000011 d[1] = 0x00008530
DEBUG: 2967 d = 0x2b708, d[0] = 0x00000012 d[1] = 0x00000008
DEBUG: 2967 d = 0x2b710, d[0] = 0x00000013 d[1] = 0x00000008
DEBUG: 2967 si->base = 0x00000000, si->



Path for .so to get linked against executable for target

by Girish » Thu, 19 Mar 2009 04:53:23 GMT


 Hi lliyan,

Any updates on this you can give ? It will be helpful.

Regards
Girish
--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by nagamatu » Thu, 19 Mar 2009 11:06:57 GMT


 ccording to your debug message, libtest1.so requires "longjmp" symbol
for link itself. Error message about '(null)' must be replace with
"longjmp"
symbol name. In linker.c, sym_name variable is used to show symbol
name, but it is not assigned to valid value at this timing. The
following
initialization statement must be done before this error message.

sym_name = (char *)(strtab + symtab[sym].st_name);

Iliyan, could you also fix this problem ?

I assume that you need implicit linking specification for libc -
because
"longjmp" is included in this library.

Regards,
nagamatu

On 38 4:44, Girish <htgir...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by kgvs.android » Sat, 28 Mar 2009 07:13:02 GMT


 I also face same issue as of Girish. The executable is not running and
halts with the error bionic/linker/linker.c:1078| ERROR:  2967 cannot
locate '(null)'...
-
Kurt Glivos
--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Eric Chen » Sat, 28 Mar 2009 22:39:35 GMT


 CRAP!!!!!!!!!!!!!!!!!!!!!!!





--~--~---------~--~----~------------~-------~--~----~



Path for .so to get linked against executable for target

by Iliyan Malchev » Sun, 29 Mar 2009 19:22:56 GMT


 This fix is already available.  You can see that the loader is now
ignoring R_ARM_NONE relocations.

 http://android.git.kernel.org/?p=platform/bionic.git ;a=blob;f=linker/linker.c;h=300a95c0dd5c7edcb21b45bfeec8f8573a456ace;hb=HEAD




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. bitmap image from a SurfaceView

Hi,

I would like to create a bitmap image from some freehand drawing on a
surface view...if someone shows me the way, that will be of immense
help... i tried setDrawingCacheEnabled(true) and getDrawingCache(true)
of the view class...but its not working...

are these two functions behave differently for surfaceview?

thanks in advance....

Som

-- 

2. Free gesture library

Hi,

does anyone know if there are any free multi touch gesture libraries out
there? The standard Android SDK only contains the one for pinch
zoom, ScaleGestureDetector, which is kind of limited... I would like
additional basic gestures like two/three finger flings. Perhaps there are
other nice basic gestures too that I haven't thought of... :-)

If someone has any info - please let me know!

... until then I'll start implementing something my self and I'll post it
here if it turns out any good...

    Best Regards
       Anton

-- 

3. Live Wallpaper Memory Allocation

4. Couldn't refresh list

5. call .net web service from android

6. Difference between zImage (bootp) and boot.img

7. Honeycomb browser broken?