gpt4 book ai didi

Android N 预览 dlopen() "has no section headers"错误

转载 作者:行者123 更新时间:2023-11-29 01:17:40 25 4
gpt4 key购买 nike

我用 UPX 压缩了我的 Android APP 的库。在 Android N Priview5 设备上运行时,出现错误:“dlopen failed: xxx.so has no section headers”。

我找到了 Android Linker 的变更日志: http://android-developers.blogspot.com/2016/06/android-changes-for-ndk-developers.html

它说“每个 ELF 文件都有包含在节 header 中的附加信息。这些 header 现在必须存在,因为动态链接器使用它们进行完整性检查。”

但是用UPX压缩后,ELF的section headers不见了,请问如何解决。

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

最佳答案

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

你可以添加一个参数:

--android-shlib 

关于Android N 预览 dlopen() "has no section headers"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38585638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com