strip命令學習筆記

2021-10-04 10:29:57 字數 484 閱讀 2742

readelf -s 看到的.debug_info 存放dwarf中的除錯資訊

readelf --debug-dump  將除錯相關的段dump出來

strip --strip-debug會將elf檔案的debug相關的section刪除,大大縮減了檔案的體積。

readelf -s filename 可以將filename的section資訊讀出來,並且可以清晰的看到每個scetion的大小。經過strip --strip-debug處理後的elf,

執行readelf -s filename,會發現filename中已經沒有debug相關的section了,比如.debug_info。如果對比strip --strip-debug前後section資訊,

會發現.shstrtab,.symtab(包含了聯結器和偵錯程式所需要的資訊),strtab的大小發生了變化,並且統計各個section的大小,會發現與檔案大小

相差較小,至於為什麼乙個位元組不差,未知。

strip 命令的用法

通過除去繫結程式和符號除錯程式使用的資訊,減少擴充套件公共物件檔案格式 xcoff 的物件檔案的大小。strip v r l x l t h e e x file strip 命令減少 xcoff 物件檔案的大小。strip 命令從 xcoff 物件檔案中有選擇地除去行號資訊 重定位資訊 除錯段 t...

Linux 命令(60) strip 命令

strip 命令是 gnu binutils 中的一員,用於剝掉目標檔案中一些符號資訊和除錯資訊,使檔案變小。strip f bfdname target bfdname i bfdname input target bfdname o bfdname output target bfdname s...

Python學習之strip 函式

strip 函式是python字串函式,對字串進行操作。功能 去掉字串頭尾指定的字元或字串行。當引數沒有時,去掉首尾空白字元。語法格式 string.strip str 名稱 含義string 指待處理的字串 str指在首尾移除的字串 無引數時 name liqin n name liqin n n...