dream
dream

Reputation: 21

Android N Preview dlopen() "has no section headers" Error

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

Upvotes: 2

Views: 2392

Answers (1)

kaitian521
kaitian521

Reputation: 578

https://github.com/upx/upx/issues/65

you can add a parameter:

--android-shlib 

Upvotes: 1

Related Questions