linux編譯問題集錦(持續更新中)


問題:fileappender.o relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPI
解決:

  1. 使用 ar -x liblog4cplus.a 解包
  2. readelf --relocs fileappender.o | egrep '(GOT|PLT|JU?MP_SLOT)' 如果輸出為空,則該靜態庫沒有position-independent,需要在該靜態庫的編譯腳本添加 -fPIC


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM