R_SH_GOT32 is unexpected for the Android Atom Loader ()

My device does not load my own library; error message

java.lang.UnsatisfiedLinkError: dlopen failed: unknown reloc type 160 @ 0xa849dc64 (6010)

In fact , and it cannot be expected from the Android bootloader.160 R_SH_GOT32

This is a minimal code example:

#include <atomic>
#define N 3
struct S {
    int a[N];
};

void qq() {
    std::atomic<S> s;
    s.exchange(S());
}

Please note that for the correct loading of the library is enough #define N 2.

I am using NDK r10e, testing on ARM 32 with the emulator installed in API 4.4.4 (API 19). I tried different toolchains: 4.8, 4.9 and clang. I tried gnustl_static and shared, as well as libC ++.

Does this smell resemble an error in NDK?

Update : using NDK 11 and clang toolchain, the linker just shows

NDK_ROOT / sources / cxx-stl / gnu-libstdC ++ / 4.9 / include / atomic: 233: error: undefined reference to '__atomic_exchange'

+4
2

android:

https://developer.android.com/ndk/guides/cpp-support.html

Google NDK 12 (GCC) : , , libatomic. ndk-build, :

LOCAL_LDLIBS + = - , :

-latomic

, .

0

ndk r10e. , .

, clang 3.5 ndk r10c.

-1

Source: https://habr.com/ru/post/1606517/


All Articles