【问题标题】:Permission denied in dlopen() APIdlopen() API 中的权限被拒绝
【发布时间】:2017-05-05 11:33:59
【问题描述】:

我正在使用 dlopen() API 在我的程序中打开一个共享对象。但出现以下错误:

cannot restore segment prot after reloc: Permission denied

【问题讨论】:

    标签: c++


    【解决方案1】:

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

    chcon -t texrel_shlib_t <your lib path here.>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-31
      • 1970-01-01
      • 2022-08-03
      • 2018-06-11
      • 2015-08-30
      • 2016-06-02
      相关资源
      最近更新 更多