2
votes

I compressed my Android APP's libs with UPX. When run at Android N Priview5 devices, there's an error : " dlopen failed: xxx.so has no section headers".

I find a changelog of Android Linker : http://android-developers.blogspot.com/2016/06/android-changes-for-ndk-developers.html

It says "Each ELF file has additional information contained in the section headers. These headers must be present now, because the dynamic linker uses them for sanity checking. "

But after compressed whit UPX, the ELF's section headers is missing, how can I solve this problem.

ELF Header:

Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Class: ELF32

Data: 2's complement, little endian

Version: 1 (current)

OS/ABI: UNIX - System V

ABI Version: 0

Type: DYN (Shared object file)

Machine: ARM

Version: 0x1

Entry point address: 0x0

Start of program headers: 52 (bytes into file)

Start of section headers: 0 (bytes into file)

Flags: 0x5000000, Version5 EABI

Size of this header: 52 (bytes)

Size of program headers: 32 (bytes)

Number of program headers: 7

Size of section headers: 0 (bytes)

Number of section headers: 0

Section header string table index: 0

1
The man-page for upx says "Since version 0.82 the section headers are stripped from the UPX stub", and I see no option to disable this, so I'm not sure if it will be possible for you to keep using UPX. Perhaps there are other packers that are compatible with the latest Android N preview.Michael
Thank you for your answer. I also found this info, but 0.82 is a very old release, I can't find the source code and see it's change. Google says "This doesn’t really help because it is possible to reconstruct the stripped information using widely-available tools." . Do you know the "widely-available tools" she means?dream

1 Answers

1
votes