在Dlopen()API中拒绝许可

Permission denied in dlopen() API

本文关键字:拒绝 许可 API Dlopen      更新时间:2023-10-16

我使用dlopen((api在程序中打开一个共享对象。但是要低于错误:

cannot restore segment prot after reloc: Permission denied

dlopen可能无法重新放置您共享库的文本段。在这种情况下,我们可以更改权限,以动态选择重定位。您需要使用root权限执行以下命令来更改权限。

chcon -t texrel_shlib_t <your lib path here.>