Relocations in generic ELF (EM: 8)

1,935 views
Skip to first unread message

cstoh899

unread,
Mar 7, 2012, 4:39:41 AM3/7/12
to andro...@googlegroups.com
got this error while try to build using android-ndk-r6b/ndk-build under ubuntu 11.10 and 11.04
same problem
using android-ndk-r5c/ndk-build under winxp cygwin
any idea how to fix this?
thanks

/home/pkk/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -Wl,-soname,libhello-jni.so -shared --sysroot=/home/pkk/android-ndk-r6b/platforms/android-9/arch-arm  /home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o   /home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/Chshw.a /home/pkk/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a     -Wl,--no-undefined -Wl,-z,noexecstack  -lc -lm -lsupc++ -o /home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/libhello-jni.so
/home/pkk/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: /home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/Chshw.a(HWR_engine.o): Relocations in generic ELF (EM: 8)
/home/pkk/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: /home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/Chshw.a(HWR_engine.o): Relocations in generic ELF (EM: 8)
/home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/Chshw.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [/home/pkk/android-ndk-r6b/samples/hello-jni2/obj/local/armeabi/libhello-jni.so] Error 1


Chshw.a is a prebuilt static library provided by others.

# first lib, which is prebuilt statically
#
include $(CLEAR_VARS)
LOCAL_MODULE    := Chshw
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/Chshw.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := hello-jni
LOCAL_SRC_FILES := hello-jni.c
LOCAL_STATIC_LIBRARIES := Chshw
include $(BUILD_SHARED_LIBRARY)

David Turner

unread,
Mar 7, 2012, 7:50:15 AM3/7/12
to andro...@googlegroups.com
It is likely that your prebuilt static library isn't in the correct format. Do you know how it was generated exactly? I bet it wasn't generated with an Android-compatible toolchain.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/VoX3JrhzruQJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

cstoh899

unread,
Mar 8, 2012, 4:16:49 AM3/8/12
to andro...@googlegroups.com
get another copy of the prebuilt static library from the provider, now no problem. so, confirm it's caused by previous file.
thanks...
Reply all
Reply to author
Forward
0 new messages