error: only position independent executables (PIE) are supported
来源:互联网 发布:淘宝指数查询网址 编辑:程序博客网 时间:2024/06/08 07:24
PIE, position independent executables.
Android 4.1上开始支持PIE,所以4.1之前的版本不能使用PIE的executable,而之前开发的app一般都是非PIE的。
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
在android L后,linker.cpp中,
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
所以在android L后,非PIE的exe执行都会报错error: only position independent executables (PIE) are supported.
。
1.但是如果在android 4.1之前的版本运行PIE, 也是有办法的:
The Chromium project released a wrapper that allows PIE binaries to run on pre-JB Android releases。
具体的使用方法见http://stackoverflow.com/questions/24818902/running-a-native-library-on-android-l-error-only-position-independent-executab,
其中run_pie在android L中的external\chromium_org\tools\android\run_pie
中可找到,下面是run_pie.c中的注释,说明run_pie主要是为了在linker不支持PIE的早期版本中运行PIE。
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
2.那么在android L之后的版本运行非PIE,有没有办法?
目前是没有解决方案,除非你把bionic的linker替换,具体参考下面的文章,使用其中修改编译过的linker, http://forum.xda-developers.com/google-nexus-5/development/fix-bypassing-pie-security-check-t2797731
LOCAL_PATH := $(call my-dir)# Forcefully disable PIE globally. This makes it possible to# build some binaries without PIE by adding the necessary flags# manually. These will not get reset by $(CLEAR_VARS). PIE is# force-enabled on NDK 10b so we'll need this even if APP_PIE# is set to false.TARGET_PIE := falseNDK_APP_PIE := falseinclude $(CLEAR_VARS)# Enable PIE manually. Will get reset on $(CLEAR_VARS). This# is what enabling PIE translates to behind the scenes.LOCAL_CFLAGS += -fPIELOCAL_LDFLAGS += -fPIE -pieLOCAL_MODULE := mymodLOCAL_SRC_FILES := \ mymod.cinclude $(BUILD_EXECUTABLE)include $(CLEAR_VARS)LOCAL_MODULE := mymod-nopieLOCAL_SRC_FILES := \ mymod.cinclude $(BUILD_EXECUTABLE)
- error: only position independent executables (PIE) are supported.
- error: only position independent executables (PIE) are supported.
- error: only position independent executables (PIE) are supported
- error: only position independent executables (PIE) are supported
- android PIE error: only position independent executables (PIE) are supported解决方法
- android_server pie/nonpie 解决error: only position independent executables (PIE) are supported
- android PIE error: only position independent executables (PIE) are supported解决方法
- only position independent executables (PIE) are supported的解决问题
- (OK) Android 5+ —— error: only position independent executables (PIE) are supported.
- android可执行文件出现error: only position independent executables (PIE) are supported.
- android可执行文件出现error: only position independent executables (PIE) are supported.
- NDK编译可执行文件在Android L中运行显示error: only position independent executables (PIE) are supported.失败问题解决办法。
- NDK编译可执行文件在Android L中运行显示error: only position independent executables (PIE) are supported.失败问题解决办法。
- SQL Server Profiler错误:only TrueType fonts are supported
- Only 64-bit build environments are supported beyond froyo/2.2
- Only 64-bit build environments are supported beyond froyo/2.2
- only 64-bit build environment are supported beyong froyo/2.2
- Cross origin requests are only supported for HTTP
- 1>MSVCRTD.lib(exe_main.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 "int __cdecl invoke_main(void)"
- 理解密码学中的双线性映射
- mysql游标的使用 No data
- 神经网络算法应用举例【Python实现】
- 卡方检验用于特征选择(二)
- error: only position independent executables (PIE) are supported
- Linux学习笔记20
- C语言函数memcpy(),memmove(),memcmp()用法详解
- java并发机制的底层实现原理
- mac svn 创建
- 利用 PHPStorm + Xdebug 断点调试PHP
- 1095. Cars on Campus (30)[结构体排序]
- Codeforces Round #410 (Div. 2) E. Mike and code of a permutation(拓扑序+线段树)
- IOS 面试题汇总2017