Skip to content

Linux compile link

WinChua edited this page May 9, 2020 · 8 revisions

rpath

  • 相关文档查看: man ld.so; man ld
  • 操作: patchelf
  • 相关变量:
    • ORIGIN: gcc -Wl,-rpath, '$ORIGIN/../lib' main.c
      ORIGIN的作用是将rpath的搜索路径设置为可执行文件
      运行时相对路径, 类似于bash的
      cur_dir=`dirname $0`
      cd ${cur_dir}
    

Clone this wiki locally