zoukankan      html  css  js  c++  java
  • chrpath工具使用

    转载:http://www.cnblogs.com/kungfupanda/p/3708799.html

    chrpath是用来改变程序的depends lib 的搜索路径的,比如我们一般使用
    $ldd  application
        linux-vdso.so.1 =>  (0x00007fff89844000)
        libQt3Support.so.4 => /usr/lib/libQt3Support.so.4 (0x00007f53f7424000)
        libQtSql.so.4 => /usr/lib/libQtSql.so.4 (0x00007f53f71e6000)
        libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0x00007f53f6f9f000)
        libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x00007f53f6c84000)
        libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0x00007f53f60d0000)
        libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x00007f53f5c99000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f53f5a7d000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f53f576d000)
        libm.so.6 => /lib/libm.so.6 (0x00007f53f54e9000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f53f52d2000)
    那么我们现在想改变一个so库的搜索路径,不使用/usr/lib/下面的,而是用/usr/local/lib目录下面的,那么就可以使用chrpath工具了

    $chrpath -r "/usr/local/lib/" application
    application: RUNPATH=/usr/lib
    application: new RUNPATH: /usr/local/lib

    $chrpath -c application
    application: RUNPATH=/usr/local/lib

    $ldd application
        linux-vdso.so.1 =>  (0x00007fff76555000)
        libQt3Support.so.4 => /usr/local/lib/libQt3Support.so.4 (0x00007ff62e8a8000)
        libQtSql.so.4 => /usr/local/lib/libQtSql.so.4 (0x00007ff62e666000)
        libQtXml.so.4 => /usr/local/lib/libQtXml.so.4 (0x00007ff62e41d000)
        libQtNetwork.so.4 => /usr/local/lib/libQtNetwork.so.4 (0x00007ff62e0f0000)
        libQtGui.so.4 => /usr/local/lib/libQtGui.so.4 (0x00007ff62d436000)
        libQtCore.so.4 => /usr/local/lib/libQtCore.so.4 (0x00007ff62cfa6000)

    That which didn't kill me makes me stronger
  • 相关阅读:
    标签切换JS代码
    use selenium in scrapy webdriver
    scrapy yield Request
    爱拼图游戏android源码完整版
    ios球体弹跳游戏源码
    android版猜拳游戏源码分享
    萝卜家园32位和64位Win7系统Ghost版
    Android开发教程大全介绍
    怎样可以让你抓住数字教育产品新机遇
    Android版年年有鱼游戏源码
  • 原文地址:https://www.cnblogs.com/pengdonglin137/p/3711350.html
Copyright © 2011-2022 走看看