{"id":6500,"date":"2020-01-21T11:14:23","date_gmt":"2020-01-21T03:14:23","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6500"},"modified":"2020-01-21T16:47:54","modified_gmt":"2020-01-21T08:47:54","slug":"readelf","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/readelf","title":{"rendered":"readelf\u547d\u4ee4 – \u663e\u793aelf\u683c\u5f0f\u6587\u4ef6\u7684\u4fe1\u606f"},"content":{"rendered":"\n
readelf\u547d\u4ee4\u7528\u6765\u663e\u793a\u4e00\u4e2a\u6216\u8005\u591a\u4e2aelf\u683c\u5f0f\u7684\u76ee\u6807\u6587\u4ef6\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b83\u7684\u9009\u9879\u6765\u63a7\u5236\u663e\u793a\u54ea\u4e9b\u4fe1\u606f\u3002\u8fd9\u91cc\u7684elf-file(s)\u5c31\u8868\u793a\u90a3\u4e9b\u88ab\u68c0\u67e5\u7684\u6587\u4ef6\u3002\u53ef\u4ee5\u652f\u630132\u4f4d\uff0c64\u4f4d\u7684elf\u683c\u5f0f\u6587\u4ef6\uff0c\u4e5f\u652f\u6301\u5305\u542belf\u6587\u4ef6\u7684\u6587\u6863\uff08\u8fd9\u91cc\u4e00\u822c\u6307\u7684\u662f\u4f7f\u7528ar\u547d\u4ee4\u5c06\u4e00\u4e9belf\u6587\u4ef6\u6253\u5305\u4e4b\u540e\u751f\u6210\u7684\u4f8b\u5982lib*.a\u4e4b\u7c7b\u7684\u201c\u9759\u6001\u5e93\u201d\u6587\u4ef6\uff09\u3002<\/p>\n\n\n\n
\u8fd9\u4e2a\u7a0b\u5e8f\u548cobjdump\u63d0\u4f9b\u7684\u529f\u80fd\u7c7b\u4f3c\uff0c\u4f46\u662f\u5b83\u663e\u793a\u7684\u4fe1\u606f\u66f4\u4e3a\u5177\u4f53\uff0c\u5e76\u4e14\u5b83\u4e0d\u4f9d\u8d56BFD\u5e93(BFD\u5e93\u662f\u4e00\u4e2aGNU\u9879\u76ee\uff0c\u5b83\u7684\u76ee\u6807\u5c31\u662f\u5e0c\u671b\u901a\u8fc7\u4e00\u79cd\u7edf\u4e00\u7684\u63a5\u53e3\u6765\u5904\u7406\u4e0d\u540c\u7684\u76ee\u6807\u6587\u4ef6)\uff0c\u6240\u4ee5\u5373\u4f7fBFD\u5e93\u6709\u4ec0\u4e48bug\u5b58\u5728\u7684\u8bdd\u4e5f\u4e0d\u4f1a\u5f71\u54cd\u5230readelf\u7a0b\u5e8f\u3002<\/p>\n\n\n\n
\u8fd8\u9700\u6ce8\u610f\u7684\u662f\u8fd0\u884creadelf\u7684\u65f6\u5019\uff0c\u9664\u4e86-v\u548c-H\u4e4b\u5916\uff0c\u5176\u5b83\u7684\u9009\u9879\u5fc5\u987b\u6709\u4e00\u4e2a\u88ab\u6307\u5b9a\u3002<\/p>\n\n\n\n
\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>readelf [\u53c2\u6570] [\u6587\u4ef6\u540d]<\/p>\n\n\n\n \u5e38\u7528\u9009\u9879\uff1a<\/strong><\/p>\n\n\n\n \u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n \u8bfb\u53d6\u53ef\u6267\u884c\u6587\u4ef6\u5f62\u5f0f\u7684elf\u6587\u4ef6\u5934\u4fe1\u606f\uff1a<\/p>\n\n\n\n \u8bfb\u53d6\u76ee\u6807\u6587\u4ef6\u5f62\u5f0f\u7684elf\u6587\u4ef6\u5934\u4fe1\u606f\uff1a<\/p>\n\n\n\n \u8bfb\u53d6\u9759\u6001\u5e93\u6587\u4ef6\u5f62\u5f0f\u7684elf\u6587\u4ef6\u5934\u4fe1\u606f\uff1a<\/p>\n\n\n\n \u8bfb\u53d6\u52a8\u6001\u5e93\u6587\u4ef6\u5f62\u5f0f\u7684elf\u6587\u4ef6\u5934\u4fe1\u606f\uff1a<\/p>\n\n\n\n \u67e5\u770b\u53ef\u6267\u884c\u7684elf\u6587\u4ef6\u7a0b\u5e8f\u5934\u8868\u4fe1\u606f\uff1a<\/p>\n\n\n\n readelf\u547d\u4ee4\u7528\u6765\u663e\u793a\u4e00\u4e2a\u6216\u8005\u591a\u4e2aelf\u683c\u5f0f\u7684\u76ee\u6807\u6587\u4ef6\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b83\u7684\u9009\u9879\u6765\u63a7\u5236\u663e\u793a\u54ea\u4e9b\u4fe1\u606f\u3002\u8fd9\u91cc\u7684e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6500"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6500"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6500\/revisions"}],"predecessor-version":[{"id":6563,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6500\/revisions\/6563"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}-a<\/td> \u663e\u793a\u5168\u90e8\u4fe1\u606f <\/td><\/tr> -h<\/td> \u663e\u793aelf\u6587\u4ef6\u5f00\u59cb\u7684\u6587\u4ef6\u5934\u4fe1\u606f <\/td><\/tr> -S<\/td> \u663e\u793a\u8282\u5934\u4fe1\u606f <\/td><\/tr> -g<\/td> \u663e\u793a\u8282\u7ec4\u4fe1\u606f <\/td><\/tr> -V<\/td> \u663e\u793a\u7248\u672c\u6bb5\u7684\u4fe1\u606f <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n [root@linuxcool ~]# readelf -h main <\/pre>\n\n\n\n
[root@linuxcool ~]# readelf -h myfile.o <\/pre>\n\n\n\n
[root@linuxcool ~]# readelf -h libmy.a <\/pre>\n\n\n\n
[root@linuxcool ~]# readelf -h libmy.so <\/pre>\n\n\n\n
[root@linuxcool ~]# readelf -l main <\/pre>\n","protected":false},"excerpt":{"rendered":"