error: only position independent executables (PIE) are supported.

简介: root@hlte:/data/local # ./tcpdump -p -s 0 error: only position independent executables (PIE) are supported.由于使用了NDK编译的可执行文件在应用中调用,在4.4及之前的版本上一直没出问题。
root@hlte:/data/local # ./tcpdump -p -s 0                                       
error: only position independent executables (PIE) are supported.

由于使用了NDK编译的可执行文件在应用中调用,在4.4及之前的版本上一直没出问题。最近由于要测试在Android L上的运行情况发现,当运行该可执行文件时,报上面的错误。

PIE这个安全机制从4.1引入,但是Android L之前的系统版本并不会去检验可执行文件是否基于PIE编译出的。因此不会报错。但是Android L已经开启验证,如果调用的可执行文件不是基于PIE方式编译的,则无法运行。解决办法是在Android.mk中加入如下flag就行。

LOCAL_CFLAGS += -pie -fPIE
LOCAL_LDFLAGS += -pie -fPIE

基于tcpdump的Android智能移动终端数据包捕获完整解决方案

Android tcpdump抓包应用实现

Android通过tcpdump抓包

相关文章
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
2523 0
|
4月前
|
Ubuntu Linux Python
UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font.
UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font.
212 2
|
6月前
|
算法 光互联 计算机视觉
Locally Adaptive Color Correction for Underwater Image Dehazing and Matching
该文提出了一种新颖的水下图像处理方法,结合颜色转移和局部调整来校正颜色,以应对水下光照和散射造成的图像退化。传统颜色转移方法基于全局参数,不适应水下场景中颜色变化的局部性质。文章中,作者通过融合策略,利用光衰减水平估计来实现局部颜色校正。首先,通过暗通道先验恢复彩色补偿图像,然后估计光衰减图。接着,创建一个合成图像,该图像的统计特性代表高衰减区域,用于颜色转移。最后,通过加权融合初始图像和颜色转移图像,生成最终的颜色校正图像。这种方法旨在提高水下图像的对比度和颜色准确性,特别关注高衰减区域。
85 1
|
6月前
解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
122 5
|
6月前
【echarts报错】: ‘normal‘ hierarchy in itemStyle has been removed since 4.0.
【echarts报错】: ‘normal‘ hierarchy in itemStyle has been removed since 4.0.
357 0
|
计算机视觉
The specified pixels is not supported
The specified pixels is not supported
126 1
|
机器学习/深度学习 PyTorch 算法框架/工具
【完美解决】RuntimeError: one of the variables needed for gradient computation has been modified by an inp
将loss.backward()函数内的参数retain_graph值设置为True, loss.backward(retain_graph=True),如果retain_graph设置为False,计算过程中的中间变量使用完即被释放掉。
1618 0
UserWarning: Glyph 28857 (\N{CJK UNIFIED IDEOGRAPH-70B9}) missing from current font. FigureCanvasA
UserWarning: Glyph 28857 (\N{CJK UNIFIED IDEOGRAPH-70B9}) missing from current font. FigureCanvasA
UserWarning: Glyph 28857 (\N{CJK UNIFIED IDEOGRAPH-70B9}) missing from current font. FigureCanvasA
ValueError: Error when checking : expected input_1 to have 4 dimensions, but got array with shape
ValueError: Error when checking : expected input_1 to have 4 dimensions, but got array with shape
399 0