prebuilt libraries "unknown reloc type 19"

703 views
Skip to first unread message

tfortier

unread,
Nov 10, 2009, 8:24:44 PM11/10/09
to android-ndk
I am trying to load third party, prebuilt libraries.

I did "readelf -d" on all of the libraries and found I needed:
libc.so.6
libpthread.so.0
ld-linux.so.3
libdl.so.2

I pushed the libs to /system/lib and /data/data/<package>/lib and the
it can find all of the dependencies but fails on libc.so.6

logcat outputs - "could not load needed library 'libc.so.6' for
'liba.so' (reloc_library[1288]: 541 unknown reloc type 19)"

I'm not sure where to go next here.

David Turner

unread,
Nov 11, 2009, 1:30:28 AM11/11/09
to andro...@googlegroups.com
It looks like you're trying to load GLibc (libc.so.6) with the Android dynamic linker, more precisely
that you're trying to dlopen() libc.so.6 from an Android process.

This is not supported, as a C library and its dynamic linker are carefully dependent on each other for various technical reasons.


--

You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=.



tfortier

unread,
Nov 11, 2009, 9:19:03 AM11/11/09
to android-ndk
Is there a way to get around this statically with the libs mentioned
above?



On Nov 11, 1:30 am, David Turner <di...@android.com> wrote:
> It looks like you're trying to load GLibc (libc.so.6) with the Android
> dynamic linker, more precisely
> that you're trying to dlopen() libc.so.6 from an Android process.
>
> This is not supported, as a C library and its dynamic linker are carefully
> dependent on each other for various technical reasons.
>

David Turner

unread,
Nov 11, 2009, 1:33:51 PM11/11/09
to andro...@googlegroups.com
I very much doubt it, these libraries include a C library and a pthread implementation that are sure to conflict with the existing Android ones.

The only solution would be to generate a static executable program (which only relies on the Linux kernel). However, this would not be a proper
Android application (no manifest, no set of permissions, etc..) and is not guaranteed to run properly.
Reply all
Reply to author
Forward
0 new messages