Mylib.so has text permutations. This is a waste of memory and a security risk. Please correct

My Android app (using the native library) will print this warning on Android 4.4:

linker mylib.so has text moving. This is a waste of memory and a security risk. Please correct.

Do you have an idea of ​​what it is and how to fix it? Thank,

+40
android native android-4.4-kitkat
Nov 22 '13 at 9:39 on
source share
5 answers

This seems to be the result of two ndk-gcc errors mentioned in https://code.google.com/p/android/issues/detail?id=23203

and stated that it was fixed as ndk-r8c.

It seems that the check for libraries with the problem was added only recently.

Note: please do not edit this post to hide the URL of the link. This is explicit because designation is what makes it authoritative.

Additional Note Changing NDK versions is only a fix when the warning is associated with your application code. It will have no effect if instead there is a warning on a system component such as libdvm, which can only be fixed by updating the system.

+25
Dec 02 '13 at 23:19
source share

You need to make the code in your cell independent ... add -fpic or -fpic to your LOCALC_FLAGS in Android.mk, and you also need to make sure that you are not linking to any static or shared libraries that themselves contain text relay. If they do, and you can compile them, use one of the flags mentioned above.

+4
Aug 19 '15 at 15:48
source share

In short, you need to compile your library with one of the -fpic or -fpic , where PIC is the abbreviation for Independent Code Position .

The longer answer is that your yourlib.so file was compiled in a way that does not comply with the Google Android standard for the ELF file, where this Dynamic Array Tag entry is unexpected. At best, the library will still work, but it is still a bug, and a future version of AOS will probably prevent it from starting.

DT_TEXTREL 0x16 (22)

To verify that your library uses something line by line:

 # readelf --wide -S yourlib.so There are 37 section headers, starting at offset 0x40: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 0000000000000000 002400 068f80 00 AX 0 0 16 [ 2] .rodata PROGBITS 0000000000000000 06b380 05ad00 00 WA 0 0 32 ... [16] .rela.text RELA 0000000000000000 26b8e8 023040 18 14 1 8 ... [36] .rela.debug_frame RELA 0000000000000000 25a608 0112e0 18 14 27 8 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), l (large) I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) 

Please see my extensive answer on this topic for more details on the DT entry . More on how to write the right dynamic libraries is a must-read .

+3
Mar 29 '17 at 17:05
source share

I got the same error with my application. The application used its own daemon, which used its own library, which did not perform all the functions in its header file. When I added the necessary implementations to my native library, everything just worked.

I do not know if you have the same problem, but that probably means that your home side has some inconsistency.

+1
Sep 28 '14 at 13:27
source share

Moving libnba2k13.so:relocations

0
Dec 11 '18 at 16:42
source share



All Articles