{"id":97679,"date":"2026-08-30T00:01:00","date_gmt":"2026-08-29T16:01:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/97679.html"},"modified":"2026-08-30T00:01:00","modified_gmt":"2026-08-29T16:01:00","slug":"%e3%80%90linux%e6%8c%87%e5%8d%97%e3%80%91%e5%8a%a8%e9%9d%99%e6%80%81%e5%ba%93%e7%b3%bb%e5%88%97%ef%bc%88%e5%85%ad%ef%bc%89%ef%bc%9a%e7%bc%96%e8%af%91%e3%80%81%e9%93%be%e6%8e%a5%e4%b8%8e-elf%ef%bc%9a-o","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/97679.html","title":{"rendered":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u4e00\u3001\u5148\u56de\u987e\u7f16\u8bd1\u548c\u94fe\u63a5<\/li>\n<li>\u4e8c\u3001.o \u6587\u4ef6\u662f\u4ec0\u4e48<\/li>\n<li>\u4e09\u3001ELF \u662f\u4ec0\u4e48<\/li>\n<li>\u56db\u3001ELF \u7684\u51e0\u79cd\u5e38\u89c1\u7c7b\u578b<\/li>\n<li>\n<ul>\n<li>1. \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6 Relocatable File<\/li>\n<li>2. \u53ef\u6267\u884c\u6587\u4ef6 Executable File<\/li>\n<li>3. \u5171\u4eab\u76ee\u6807\u6587\u4ef6 Shared Object File<\/li>\n<li>4. Core dump<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001ELF \u6587\u4ef6\u6574\u4f53\u7531\u54ea\u4e9b\u90e8\u5206\u7ec4\u6210<\/li>\n<li>\n<ul>\n<li>1. ELF Header<\/li>\n<li>2. Section Header Table<\/li>\n<li>3. Program Header Table<\/li>\n<li>4. Sections<\/li>\n<\/ul>\n<\/li>\n<li>\u516d\u3001\u5e38\u89c1 section \u89e3\u91ca<\/li>\n<li>\n<ul>\n<li>1. .text<\/li>\n<li>2. .data<\/li>\n<li>3. .bss<\/li>\n<li>4. .symtab<\/li>\n<li>5. .got \u548c .plt<\/li>\n<\/ul>\n<\/li>\n<li>\u4e03\u3001\u94fe\u63a5\u89c6\u56fe\u548c\u6267\u884c\u89c6\u56fe<\/li>\n<li>\n<ul>\n<li>1. \u94fe\u63a5\u89c6\u56fe<\/li>\n<li>2. \u6267\u884c\u89c6\u56fe<\/li>\n<\/ul>\n<\/li>\n<li>\u516b\u3001\u4e3a\u4ec0\u4e48 section \u8981\u5408\u5e76\u6210 segment<\/li>\n<li>\u4e5d\u3001\u52a8\u9759\u6001\u5e93\u4e0e ELF \u7684\u5173\u7cfb<\/li>\n<li>\n<ul>\n<li>1. \u9759\u6001\u5e93<\/li>\n<li>2. \u52a8\u6001\u5e93<\/li>\n<li>3. \u53ef\u6267\u884c\u6587\u4ef6<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u3001\u5e38\u7528\u89c2\u5bdf\u547d\u4ee4<\/li>\n<li>\n<ul>\n<li>1. file<\/li>\n<li>2. readelf -h<\/li>\n<li>3. readelf -S<\/li>\n<li>4. readelf -l<\/li>\n<li>5. size<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u4e00\u3001\u4e00\u4e2a\u63a8\u8350\u5b9e\u9a8c<\/li>\n<li>\u5341\u4e8c\u3001\u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u524d\u51e0\u7bc7\u6211\u4eec\u5df2\u7ecf\u4f1a\u5236\u4f5c\u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93&#xff0c;\u4e5f\u89e3\u51b3\u4e86\u52a8\u6001\u5e93\u8fd0\u884c\u671f\u627e\u4e0d\u5230\u7684\u95ee\u9898\u3002\u4f46\u5982\u679c\u53ea\u505c\u7559\u5728\u547d\u4ee4\u5c42\u9762&#xff0c;\u5f88\u5bb9\u6613\u628a gcc\u3001ar\u3001ldd\u3001readelf \u5f53\u6210\u4e00\u5806\u96f6\u6563\u5de5\u5177\u3002<\/p>\n<p>\u4ece\u8fd9\u7bc7\u5f00\u59cb&#xff0c;\u6211\u4eec\u5f80\u5e95\u5c42\u8d70\u4e00\u6b65&#xff1a;\u770b\u770b .o\u3001.a\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u80cc\u540e\u5230\u5e95\u662f\u4ec0\u4e48\u3002\u4f60\u4f1a\u53d1\u73b0&#xff0c;\u5b83\u4eec\u90fd\u7ed5\u4e0d\u5f00\u4e00\u4e2a\u6838\u5fc3\u683c\u5f0f&#xff1a;ELF\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260829160055-6a9302374a6f5.png\" alt=\"image.png\" \/><\/p>\n<h3>\u4e00\u3001\u5148\u56de\u987e\u7f16\u8bd1\u548c\u94fe\u63a5<\/h3>\n<p>\u4e00\u4e2a C \u7a0b\u5e8f\u4ece\u6e90\u7801\u53d8\u6210\u53ef\u6267\u884c\u7a0b\u5e8f&#xff0c;\u5927\u81f4\u7ecf\u8fc7\u8fd9\u4e9b\u9636\u6bb5&#xff1a;<\/p>\n<p>\u9884\u5904\u7406 -&gt; \u7f16\u8bd1 -&gt; \u6c47\u7f16 -&gt; \u94fe\u63a5<\/p>\n<p>\u5e73\u65f6\u6211\u4eec\u4e00\u6761\u547d\u4ee4&#xff1a;<\/p>\n<p>gcc main.c <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u770b\u8d77\u6765\u4e00\u6b65\u5b8c\u6210&#xff0c;\u5b9e\u9645\u4e0a gcc \u5e2e\u6211\u4eec\u4e32\u8d77\u4e86\u591a\u4e2a\u9636\u6bb5\u3002<\/p>\n<p>\u5982\u679c\u62c6\u5f00\u770b&#xff0c;\u53ef\u4ee5\u5148\u751f\u6210\u76ee\u6807\u6587\u4ef6&#xff1a;<\/p>\n<p>gcc <span class=\"token parameter variable\">-c<\/span> main.c <span class=\"token parameter variable\">-o<\/span> main.o<\/p>\n<p>\u8fd9\u91cc\u7684 -c \u8868\u793a\u53ea\u7f16\u8bd1&#xff0c;\u4e0d\u94fe\u63a5\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260829160057-6a93023958393.png\" alt=\"image.png\" \/> \u6b64\u65f6 main.o \u8fd8\u4e0d\u662f\u53ef\u6267\u884c\u7a0b\u5e8f\u3002\u5b83\u53ea\u662f\u4e00\u4e2a\u76ee\u6807\u6587\u4ef6&#xff0c;\u91cc\u9762\u6709\u673a\u5668\u6307\u4ee4\u3001\u6570\u636e\u3001\u7b26\u53f7\u8868\u3001\u91cd\u5b9a\u4f4d\u4fe1\u606f\u7b49\u3002<\/p>\n<p>\u591a\u4e2a .o \u6700\u540e\u8fd8\u8981\u94fe\u63a5&#xff1a;<\/p>\n<p>gcc main.o code.o <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u94fe\u63a5\u9636\u6bb5\u4f1a\u628a\u591a\u4e2a\u76ee\u6807\u6587\u4ef6\u548c\u7528\u5230\u7684\u5e93\u7ec4\u5408\u6210\u6700\u7ec8\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n<h3>\u4e8c\u3001.o \u6587\u4ef6\u662f\u4ec0\u4e48<\/h3>\n<p>.o \u662f\u76ee\u6807\u6587\u4ef6\u3002\u5b83\u5df2\u7ecf\u4e0d\u662f C \u6e90\u7801&#xff0c;\u800c\u662f\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<p>\u53ef\u4ee5\u7528 file \u67e5\u770b&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> main.o<\/p>\n<p>\u53ef\u80fd\u8f93\u51fa&#xff1a;<\/p>\n<p>main.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped<\/p>\n<p>\u8fd9\u91cc\u6700\u91cd\u8981\u7684\u4fe1\u606f\u662f&#xff1a;<\/p>\n<p>ELF<br \/>\nrelocatable<\/p>\n<p>\u8fd9\u8bf4\u660e .o \u6587\u4ef6\u662f ELF \u683c\u5f0f&#xff0c;\u800c\u4e14\u5c5e\u4e8e\u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6\u3002<\/p>\n<p>\u53ef\u91cd\u5b9a\u4f4d\u610f\u5473\u7740\u5b83\u8fd8\u4e0d\u80fd\u76f4\u63a5\u8fd0\u884c&#xff0c;\u9700\u8981\u548c\u5176\u4ed6\u76ee\u6807\u6587\u4ef6\u6216\u5e93\u7ee7\u7eed\u94fe\u63a5&#xff0c;\u624d\u80fd\u5f62\u6210\u53ef\u6267\u884c\u6587\u4ef6\u6216\u5171\u4eab\u5e93\u3002<\/p>\n<h3>\u4e09\u3001ELF \u662f\u4ec0\u4e48<\/h3>\n<p>ELF \u5168\u79f0\u662f Executable and Linkable Format&#xff0c;\u5373\u201c\u53ef\u6267\u884c\u4e0e\u53ef\u94fe\u63a5\u683c\u5f0f\u201d\u3002<\/p>\n<p>Linux \u4e0b\u5f88\u591a\u4e8c\u8fdb\u5236\u6587\u4ef6\u90fd\u91c7\u7528 ELF \u683c\u5f0f&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>.o \u76ee\u6807\u6587\u4ef6<br \/>\n\u53ef\u6267\u884c\u7a0b\u5e8f<br \/>\n.so \u52a8\u6001\u5e93<br \/>\ncore dump \u6587\u4ef6<\/p>\n<p>\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u7814\u7a76\u52a8\u9759\u6001\u5e93\u65f6\u5fc5\u987b\u7406\u89e3 ELF\u3002<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>.o \u662f ELF&#xff1b;<br \/>\n.so \u662f ELF&#xff1b;<br \/>\n\u53ef\u6267\u884c\u7a0b\u5e8f\u4e5f\u662f ELF&#xff1b;<br \/>\n\u94fe\u63a5\u548c\u52a0\u8f7d\u90fd\u56f4\u7ed5 ELF \u4e2d\u7684\u4fe1\u606f\u5c55\u5f00\u3002<\/p>\n<h3>\u56db\u3001ELF \u7684\u51e0\u79cd\u5e38\u89c1\u7c7b\u578b<\/h3>\n<h4>1. \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6 Relocatable File<\/h4>\n<p>\u4e5f\u5c31\u662f .o \u6587\u4ef6\u3002<\/p>\n<p>\u5b83\u5305\u542b\u4ee3\u7801\u548c\u6570\u636e&#xff0c;\u4f46\u91cc\u9762\u7684\u5f88\u591a\u5730\u5740\u8fd8\u6ca1\u6709\u6700\u7ec8\u786e\u5b9a\u3002\u94fe\u63a5\u5668\u4f1a\u6839\u636e\u8fd9\u4e9b\u4fe1\u606f\u7ee7\u7eed\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u6216\u52a8\u6001\u5e93\u3002<\/p>\n<p>\u67e5\u770b\u65b9\u5f0f&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> main.o<br \/>\nreadelf <span class=\"token parameter variable\">-h<\/span> main.o<\/p>\n<p>\u4f60\u4f1a\u770b\u5230\u7c7b\u578b\u7c7b\u4f3c&#xff1a;<\/p>\n<p>Type: REL (Relocatable file)<\/p>\n<h4>2. \u53ef\u6267\u884c\u6587\u4ef6 Executable File<\/h4>\n<p>\u4f8b\u5982\u6211\u4eec\u751f\u6210\u7684 main&#xff1a;<\/p>\n<p>gcc main.o code.o <span class=\"token parameter variable\">-o<\/span> main<br \/>\n<span class=\"token function\">file<\/span> main<\/p>\n<p>\u53ef\u80fd\u8f93\u51fa&#xff1a;<\/p>\n<p>ELF 64-bit LSB executable<\/p>\n<p>\u5b83\u53ef\u4ee5\u88ab\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u8fd0\u884c\u3002<\/p>\n<h4>3. \u5171\u4eab\u76ee\u6807\u6587\u4ef6 Shared Object File<\/h4>\n<p>\u4e5f\u5c31\u662f\u52a8\u6001\u5e93 .so&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> libmyc.so<\/p>\n<p>\u53ef\u80fd\u8f93\u51fa&#xff1a;<\/p>\n<p>ELF 64-bit LSB shared object<\/p>\n<p>.so \u53ef\u4ee5\u88ab\u52a8\u6001\u94fe\u63a5\u5668\u52a0\u8f7d\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u4e2d\u3002<\/p>\n<h4>4. Core dump<\/h4>\n<p>\u8fdb\u7a0b\u5d29\u6e83\u65f6\u4ea7\u751f\u7684 core \u6587\u4ef6&#xff0c;\u4e5f\u5c5e\u4e8e ELF \u7684\u4e00\u79cd&#xff0c;\u7528\u4e8e\u4fdd\u5b58\u8fdb\u7a0b\u5d29\u6e83\u65f6\u7684\u4e0a\u4e0b\u6587&#xff0c;\u65b9\u4fbf\u8c03\u8bd5\u3002<\/p>\n<h3>\u4e94\u3001ELF \u6587\u4ef6\u6574\u4f53\u7531\u54ea\u4e9b\u90e8\u5206\u7ec4\u6210<\/h3>\n<p>\u4e00\u4e2a ELF \u6587\u4ef6\u53ef\u4ee5\u4ece\u56db\u4e2a\u5173\u952e\u90e8\u5206\u7406\u89e3&#xff1a;<\/p>\n<p>ELF Header<br \/>\nProgram Header Table<br \/>\nSection Header Table<br \/>\nSections<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260829160057-6a930239ab329.png\" alt=\"image.png\" \/><\/p>\n<h4>1. ELF Header<\/h4>\n<p>ELF Header \u4f4d\u4e8e\u6587\u4ef6\u5f00\u5934&#xff0c;\u63cf\u8ff0\u6574\u4e2a ELF \u6587\u4ef6\u7684\u57fa\u672c\u4fe1\u606f&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<ul>\n<li>\u6587\u4ef6\u7c7b\u578b&#xff1b;<\/li>\n<li>\u76ee\u6807\u673a\u5668\u67b6\u6784&#xff1b;<\/li>\n<li>\u7a0b\u5e8f\u5165\u53e3\u5730\u5740&#xff1b;<\/li>\n<li>Program Header Table \u7684\u4f4d\u7f6e&#xff1b;<\/li>\n<li>Section Header Table \u7684\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p>\u67e5\u770b\u547d\u4ee4&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-h<\/span> main<\/p>\n<p>\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u5b57\u6bb5&#xff1a;<\/p>\n<p>Magic<br \/>\nClass<br \/>\nData<br \/>\nType<br \/>\nMachine<br \/>\nEntry point address<br \/>\nStart of program headers<br \/>\nStart of section headers<\/p>\n<p>ELF Header \u7684\u4f5c\u7528\u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>\u544a\u8bc9\u5de5\u5177\u548c\u64cd\u4f5c\u7cfb\u7edf&#xff1a;\u8fd9\u4e2a ELF \u6587\u4ef6\u662f\u4ec0\u4e48&#xff0c;\u4ee5\u53ca\u5176\u4ed6\u91cd\u8981\u7ed3\u6784\u5728\u54ea\u91cc\u3002<\/p>\n<h4>2. Section Header Table<\/h4>\n<p>Section Header Table \u63cf\u8ff0 ELF \u4e2d\u6709\u54ea\u4e9b section\u3002<\/p>\n<p>section \u662f\u94fe\u63a5\u89c6\u89d2\u4e0b\u7684\u7ec4\u7ec7\u5355\u4f4d&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<p>.text<br \/>\n.data<br \/>\n.bss<br \/>\n.symtab<br \/>\n.strtab<br \/>\n.rela.text<br \/>\n.got<br \/>\n.plt<\/p>\n<p>\u67e5\u770b\u547d\u4ee4&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-S<\/span> main.o<\/p>\n<p>\u94fe\u63a5\u5668\u5728\u94fe\u63a5 .o \u6587\u4ef6\u65f6&#xff0c;\u975e\u5e38\u5173\u5fc3 section\u3002\u6bd4\u5982\u591a\u4e2a .o \u7684 .text \u4ee3\u7801\u8282\u4f1a\u88ab\u5408\u5e76&#xff0c;\u591a\u4e2a .data \u6570\u636e\u8282\u4e5f\u4f1a\u88ab\u5408\u5e76\u3002<\/p>\n<h4>3. Program Header Table<\/h4>\n<p>Program Header Table \u63cf\u8ff0 ELF \u5982\u4f55\u88ab\u52a0\u8f7d\u5230\u5185\u5b58\u3002<\/p>\n<p>\u67e5\u770b\u547d\u4ee4&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-l<\/span> main<\/p>\n<p>\u4f60\u4f1a\u770b\u5230 LOAD\u3001INTERP \u7b49\u6bb5\u4fe1\u606f\u3002<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u53ef\u6267\u884c\u7a0b\u5e8f\u65f6&#xff0c;\u66f4\u5173\u5fc3 Program Header Table&#xff0c;\u56e0\u4e3a\u5b83\u544a\u8bc9\u7cfb\u7edf&#xff1a;<\/p>\n<p>\u54ea\u4e9b\u5185\u5bb9\u8981\u52a0\u8f7d\u5230\u5185\u5b58&#xff1b;<br \/>\n\u52a0\u8f7d\u5230\u4ec0\u4e48\u865a\u62df\u5730\u5740&#xff1b;<br \/>\n\u5185\u5b58\u533a\u57df\u6743\u9650\u662f\u4ec0\u4e48&#xff1b;<br \/>\n\u54ea\u4e9b\u6bb5\u53ef\u8bfb\u3001\u53ef\u5199\u3001\u53ef\u6267\u884c\u3002<\/p>\n<h4>4. Sections<\/h4>\n<p>Sections \u662f ELF \u4e2d\u771f\u6b63\u5b58\u653e\u4ee3\u7801\u3001\u6570\u636e\u3001\u7b26\u53f7\u7b49\u5185\u5bb9\u7684\u533a\u57df\u3002<\/p>\n<p>\u6bd4\u5982&#xff1a;<\/p>\n<p>.text  \u5b58\u653e\u673a\u5668\u6307\u4ee4<br \/>\n.data  \u5b58\u653e\u5df2\u521d\u59cb\u5316\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u53d8\u91cf<br \/>\n.bss   \u63cf\u8ff0\u672a\u521d\u59cb\u5316\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u53d8\u91cf<br \/>\n.symtab \u5b58\u653e\u7b26\u53f7\u8868<br \/>\n.got   \u5168\u5c40\u504f\u79fb\u8868<br \/>\n.plt   \u8fc7\u7a0b\u94fe\u63a5\u8868<\/p>\n<h3>\u516d\u3001\u5e38\u89c1 section \u89e3\u91ca<\/h3>\n<h4>1. .text<\/h4>\n<p>.text \u4fdd\u5b58\u7a0b\u5e8f\u7684\u673a\u5668\u6307\u4ee4&#xff0c;\u4e5f\u5c31\u662f\u51fd\u6570\u4ee3\u7801\u3002<\/p>\n<p>\u4f8b\u5982 main\u3001add\u3001my_strlen \u6700\u7ec8\u90fd\u4f1a\u5bf9\u5e94 .text \u4e2d\u7684\u4e00\u6bb5\u6307\u4ee4\u3002<\/p>\n<h4>2. .data<\/h4>\n<p>.data \u4fdd\u5b58\u5df2\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf\u6216\u9759\u6001\u53d8\u91cf\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token keyword\">int<\/span> g_val <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u79cd\u53d8\u91cf\u901a\u5e38\u4f1a\u8fdb\u5165 .data\u3002<\/p>\n<h4>3. .bss<\/h4>\n<p>.bss \u5bf9\u5e94\u672a\u521d\u59cb\u5316\u6216\u521d\u59cb\u5316\u4e3a 0 \u7684\u5168\u5c40\u53d8\u91cf\u3001\u9759\u6001\u53d8\u91cf\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token keyword\">int<\/span> g_count<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> s_flag<span class=\"token punctuation\">;<\/span><\/p>\n<p>.bss \u5f88\u7279\u522b&#xff1a;\u5b83\u901a\u5e38\u4e0d\u5728\u6587\u4ef6\u4e2d\u4fdd\u5b58\u5927\u91cf\u5b9e\u9645\u7684 0 \u6570\u636e&#xff0c;\u800c\u662f\u8bb0\u5f55\u5927\u5c0f\u3002\u7a0b\u5e8f\u52a0\u8f7d\u65f6\u518d\u5728\u5185\u5b58\u4e2d\u6e05\u96f6\u3002<\/p>\n<p>\u8fd9\u80fd\u8282\u7701\u78c1\u76d8\u7a7a\u95f4\u3002<\/p>\n<h4>4. .symtab<\/h4>\n<p>.symtab \u662f\u7b26\u53f7\u8868&#xff0c;\u8bb0\u5f55\u51fd\u6570\u540d\u3001\u53d8\u91cf\u540d\u548c\u76f8\u5173\u5730\u5740\u4fe1\u606f\u3002<\/p>\n<p>\u540e\u9762\u8bb2\u7b26\u53f7\u89e3\u6790\u548c\u91cd\u5b9a\u4f4d\u65f6\u4f1a\u91cd\u70b9\u7528\u5230\u5b83\u3002<\/p>\n<h4>5. .got \u548c .plt<\/h4>\n<p>.got \u662f\u5168\u5c40\u504f\u79fb\u8868&#xff0c;.plt \u662f\u8fc7\u7a0b\u94fe\u63a5\u8868\u3002<\/p>\n<p>\u5b83\u4eec\u548c\u52a8\u6001\u94fe\u63a5\u5bc6\u5207\u76f8\u5173&#xff0c;\u540e\u9762\u4f1a\u7528\u4e24\u7bc7\u6587\u7ae0\u4e13\u95e8\u8bb2\u3002<\/p>\n<p>\u73b0\u5728\u5148\u8bb0\u4f4f&#xff1a;<\/p>\n<p>GOT\/PLT \u662f\u52a8\u6001\u5e93\u51fd\u6570\u8c03\u7528\u7684\u91cd\u8981\u57fa\u7840\u8bbe\u65bd\u3002<\/p>\n<h3>\u4e03\u3001\u94fe\u63a5\u89c6\u56fe\u548c\u6267\u884c\u89c6\u56fe<\/h3>\n<p>ELF \u53ef\u4ee5\u4ece\u4e24\u4e2a\u89c6\u89d2\u7406\u89e3\u3002<\/p>\n<h4>1. \u94fe\u63a5\u89c6\u56fe<\/h4>\n<p>\u94fe\u63a5\u89c6\u56fe\u5173\u6ce8 section\u3002<\/p>\n<p>\u94fe\u63a5\u5668\u5904\u7406\u76ee\u6807\u6587\u4ef6\u65f6&#xff0c;\u4f1a\u5173\u5fc3&#xff1a;<\/p>\n<p>.text \u5728\u54ea\u91cc<br \/>\n.data \u5728\u54ea\u91cc<br \/>\n\u7b26\u53f7\u8868\u5728\u54ea\u91cc<br \/>\n\u91cd\u5b9a\u4f4d\u8868\u5728\u54ea\u91cc<\/p>\n<p>\u6240\u4ee5\u94fe\u63a5\u89c6\u56fe\u4e3b\u8981\u5bf9\u5e94&#xff1a;<\/p>\n<p>Section Header Table<\/p>\n<h4>2. \u6267\u884c\u89c6\u56fe<\/h4>\n<p>\u6267\u884c\u89c6\u56fe\u5173\u6ce8 segment\u3002<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u7a0b\u5e8f\u65f6&#xff0c;\u4e0d\u4f1a\u4e00\u4e2a section \u4e00\u4e2a section \u5730\u96f6\u6563\u52a0\u8f7d&#xff0c;\u800c\u662f\u6309 segment \u52a0\u8f7d\u3002<\/p>\n<p>\u6267\u884c\u89c6\u56fe\u4e3b\u8981\u5bf9\u5e94&#xff1a;<\/p>\n<p>Program Header Table<\/p>\n<p>\u53ef\u4ee5\u7b80\u5355\u603b\u7ed3&#xff1a;<\/p>\n<p>\u94fe\u63a5\u5668\u770b section&#xff1b;<br \/>\n\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u5668\u770b segment\u3002<\/p>\n<h3>\u516b\u3001\u4e3a\u4ec0\u4e48 section \u8981\u5408\u5e76\u6210 segment<\/h3>\n<p>\u4e00\u4e2a ELF \u6587\u4ef6\u91cc\u53ef\u80fd\u6709\u5f88\u591a section\u3002\u5982\u679c\u52a0\u8f7d\u65f6\u6bcf\u4e2a section \u90fd\u5355\u72ec\u6620\u5c04&#xff0c;\u4f1a\u6d6a\u8d39\u5185\u5b58\u9875&#xff0c;\u4e5f\u4e0d\u5229\u4e8e\u6743\u9650\u7ba1\u7406\u3002<\/p>\n<p>\u73b0\u4ee3\u7cfb\u7edf\u4ee5\u9875\u4e3a\u5355\u4f4d\u7ba1\u7406\u5185\u5b58&#xff0c;\u5e38\u89c1\u9875\u5927\u5c0f\u662f 4KB\u3002\u5f88\u591a section \u5f88\u5c0f&#xff0c;\u5982\u679c\u6bcf\u4e2a\u90fd\u5355\u72ec\u5360\u9875&#xff0c;\u4f1a\u9020\u6210\u5927\u91cf\u788e\u7247\u3002<\/p>\n<p>\u6240\u4ee5\u5728\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u65f6&#xff0c;\u94fe\u63a5\u5668\u4f1a\u628a\u5c5e\u6027\u76f8\u540c\u6216\u76f8\u8fd1\u7684 section \u5408\u5e76\u5230 segment \u4e2d\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u53ef\u8bfb &#043; \u53ef\u6267\u884c\u7684 section -&gt; \u5408\u5e76\u5230\u4ee3\u7801\u76f8\u5173 LOAD segment<br \/>\n\u53ef\u8bfb &#043; \u53ef\u5199\u7684 section -&gt; \u5408\u5e76\u5230\u6570\u636e\u76f8\u5173 LOAD segment<br \/>\n\u53ea\u8bfb\u6570\u636e -&gt; \u5408\u5e76\u5230\u53ea\u8bfb segment<\/p>\n<p>\u8fd9\u6837\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u65f6\u5c31\u53ef\u4ee5\u6309 segment \u5efa\u7acb\u5185\u5b58\u533a\u57df&#xff0c;\u5e76\u8bbe\u7f6e\u6743\u9650&#xff1a;<\/p>\n<p>\u4ee3\u7801\u6bb5&#xff1a;\u53ef\u8bfb\u3001\u53ef\u6267\u884c<br \/>\n\u6570\u636e\u6bb5&#xff1a;\u53ef\u8bfb\u3001\u53ef\u5199<br \/>\n\u6808&#xff1a;\u53ef\u8bfb\u3001\u53ef\u5199<\/p>\n<p>\u8fd9\u5c31\u662f readelf -l \u4e2d LOAD \u6bb5\u7684\u91cd\u8981\u610f\u4e49\u3002<\/p>\n<h3>\u4e5d\u3001\u52a8\u9759\u6001\u5e93\u4e0e ELF \u7684\u5173\u7cfb<\/h3>\n<p>\u73b0\u5728\u56de\u5934\u770b\u524d\u9762\u51e0\u7bc7\u7684\u5185\u5bb9&#xff1a;<\/p>\n<h4>1. \u9759\u6001\u5e93<\/h4>\n<p>\u9759\u6001\u5e93 .a \u662f\u591a\u4e2a .o \u7684\u5f52\u6863\u5305&#xff0c;\u800c .o \u662f ELF \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6\u3002<\/p>\n<p>\u6240\u4ee5\u9759\u6001\u5e93\u672c\u8d28\u4e0a\u662f\u5728\u7ec4\u7ec7\u4e00\u6279 ELF \u76ee\u6807\u6587\u4ef6\u3002<\/p>\n<h4>2. \u52a8\u6001\u5e93<\/h4>\n<p>\u52a8\u6001\u5e93 .so \u672c\u8eab\u5c31\u662f ELF \u5171\u4eab\u76ee\u6807\u6587\u4ef6\u3002<\/p>\n<p>\u5b83\u53ef\u4ee5\u88ab\u94fe\u63a5\u5668\u5f15\u7528&#xff0c;\u4e5f\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u88ab\u52a8\u6001\u94fe\u63a5\u5668\u52a0\u8f7d\u3002<\/p>\n<h4>3. \u53ef\u6267\u884c\u6587\u4ef6<\/h4>\n<p>\u6700\u7ec8\u7a0b\u5e8f\u4e5f\u662f ELF\u3002\u5b83\u7684 Program Header Table \u4f1a\u544a\u8bc9\u64cd\u4f5c\u7cfb\u7edf\u5982\u4f55\u52a0\u8f7d\u5b83\u3002<\/p>\n<p>\u6240\u4ee5\u6574\u4e2a\u94fe\u6761\u53ef\u4ee5\u5199\u6210&#xff1a;<\/p>\n<p>.c -&gt; .o(ELF REL) -&gt; .a \u6216 .so -&gt; \u53ef\u6267\u884c\u6587\u4ef6(ELF EXEC\/DYN)<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260829160057-6a930239cbacf.png\" alt=\"image.png\" \/><\/p>\n<h3>\u5341\u3001\u5e38\u7528\u89c2\u5bdf\u547d\u4ee4<\/h3>\n<h4>1. file<\/h4>\n<p>\u67e5\u770b\u6587\u4ef6\u5927\u7c7b&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> main.o<br \/>\n<span class=\"token function\">file<\/span> libmyc.so<br \/>\n<span class=\"token function\">file<\/span> main<\/p>\n<h4>2. readelf -h<\/h4>\n<p>\u67e5\u770b ELF Header&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-h<\/span> main<\/p>\n<h4>3. readelf -S<\/h4>\n<p>\u67e5\u770b section&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-S<\/span> main.o<br \/>\nreadelf <span class=\"token parameter variable\">-S<\/span> main<\/p>\n<h4>4. readelf -l<\/h4>\n<p>\u67e5\u770b segment&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-l<\/span> main<\/p>\n<h4>5. size<\/h4>\n<p>\u67e5\u770b\u5404\u6bb5\u5927\u81f4\u5927\u5c0f&#xff1a;<\/p>\n<p>size main<\/p>\n<p>\u8f93\u51fa\u4e2d\u5e38\u89c1&#xff1a;<\/p>\n<p>text data bss<\/p>\n<p>\u8fd9\u80fd\u5e2e\u52a9\u4f60\u89c2\u5bdf\u7a0b\u5e8f\u4e2d\u4ee3\u7801\u3001\u5df2\u521d\u59cb\u5316\u6570\u636e\u3001\u672a\u521d\u59cb\u5316\u6570\u636e\u5206\u522b\u5360\u591a\u5c11\u7a7a\u95f4\u3002<\/p>\n<h3>\u5341\u4e00\u3001\u4e00\u4e2a\u63a8\u8350\u5b9e\u9a8c<\/h3>\n<p>\u51c6\u5907\u4e24\u4e2a\u6587\u4ef6\u3002<\/p>\n<p>hello.c&#xff1a;<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">extern<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">run<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;hello\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">run<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>code.c&#xff1a;<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">run<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;run\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u7f16\u8bd1\u6210 .o&#xff1a;<\/p>\n<p>gcc <span class=\"token parameter variable\">-c<\/span> hello.c<br \/>\ngcc <span class=\"token parameter variable\">-c<\/span> code.c<\/p>\n<p>\u89c2\u5bdf&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> hello.o<br \/>\nreadelf <span class=\"token parameter variable\">-h<\/span> hello.o<br \/>\nreadelf <span class=\"token parameter variable\">-S<\/span> hello.o<\/p>\n<p>\u94fe\u63a5&#xff1a;<\/p>\n<p>gcc hello.o code.o <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u89c2\u5bdf\u53ef\u6267\u884c\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> main<br \/>\nreadelf <span class=\"token parameter variable\">-h<\/span> main<br \/>\nreadelf <span class=\"token parameter variable\">-l<\/span> main<br \/>\nreadelf <span class=\"token parameter variable\">-S<\/span> main<\/p>\n<p>\u4f60\u4f1a\u770b\u5230&#xff1a;<\/p>\n<p>.o \u662f\u53ef\u91cd\u5b9a\u4f4d ELF&#xff1b;<br \/>\nmain \u662f\u53ef\u6267\u884c ELF&#xff1b;<br \/>\nmain \u6709 Program Header Table&#xff1b;<br \/>\nsection \u4f1a\u6620\u5c04\u5230 segment\u3002<\/p>\n<h3>\u5341\u4e8c\u3001\u603b\u7ed3<\/h3>\n<p>ELF \u662f\u7406\u89e3 Linux \u7f16\u8bd1\u3001\u94fe\u63a5\u3001\u5e93\u548c\u52a0\u8f7d\u7684\u5173\u952e\u3002<\/p>\n<p>.o\u3001.so\u3001\u53ef\u6267\u884c\u7a0b\u5e8f\u90fd\u548c ELF \u6709\u5173&#xff1a;<\/p>\n<p>.o&#xff1a;ELF \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6<br \/>\n.so&#xff1a;ELF \u5171\u4eab\u76ee\u6807\u6587\u4ef6<br \/>\n\u53ef\u6267\u884c\u7a0b\u5e8f&#xff1a;ELF \u53ef\u6267\u884c\u6587\u4ef6\u6216 PIE \u5f62\u5f0f\u5171\u4eab\u5bf9\u8c61<\/p>\n<p>\u94fe\u63a5\u5668\u4e3b\u8981\u5173\u6ce8 section&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u7a0b\u5e8f\u4e3b\u8981\u5173\u6ce8 segment\u3002\u7406\u89e3\u8fd9\u4e00\u70b9&#xff0c;\u540e\u9762\u8bb2\u7b26\u53f7\u8868\u3001\u91cd\u5b9a\u4f4d\u3001\u52a8\u6001\u5e93\u6620\u5c04\u3001GOT\/PLT \u65f6\u5c31\u4e0d\u4f1a\u8ff7\u8def\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7&#xff0c;\u6211\u4eec\u7ee7\u7eed\u6df1\u5165\u94fe\u63a5\u5668\u6700\u6838\u5fc3\u7684\u5de5\u4f5c&#xff1a;\u7b26\u53f7\u89e3\u6790\u4e0e\u91cd\u5b9a\u4f4d\u3002\u4e5f\u5c31\u662f\u94fe\u63a5\u5668\u5230\u5e95\u5982\u4f55\u628a\u4e00\u4e2a\u6587\u4ef6\u91cc\u7684\u51fd\u6570\u8c03\u7528&#xff0c;\u63a5\u5230\u53e6\u4e00\u4e2a\u6587\u4ef6\u91cc\u7684\u51fd\u6570\u5b9e\u73b0\u4e0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u76ee\u5f55\u4e00\u3001\u5148\u56de\u987e\u7f16\u8bd1\u548c\u94fe\u63a5\u4e8c\u3001.o \u6587\u4ef6\u662f\u4ec0\u4e48\u4e09\u3001ELF \u662f\u4ec0\u4e48\u56db\u3001ELF \u7684\u51e0\u79cd\u5e38\u89c1\u7c7b\u578b1. \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6 Relocatable File2. \u53ef\u6267\u884c\u6587\u4ef6 Executable File3. \u5171\u4eab\u76ee\u6807\u6587\u4ef6 Shared Object File4. Core dump\u4e94\u3001ELF \u6587\u4ef6\u6574\u4f53\u7531\u54ea\u4e9b\u90e8\u5206\u7ec4\u62101. ELF Header2. Section Header Table3. Program Header Table4. Sections\u516d\u3001\u5e38\u89c1 section \u89e3\u91ca1.<\/p>\n","protected":false},"author":2,"featured_media":97675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,58,3440],"topic":[],"class_list":["post-97679","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-linux","tag-restful"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/97679.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u76ee\u5f55\u4e00\u3001\u5148\u56de\u987e\u7f16\u8bd1\u548c\u94fe\u63a5\u4e8c\u3001.o \u6587\u4ef6\u662f\u4ec0\u4e48\u4e09\u3001ELF \u662f\u4ec0\u4e48\u56db\u3001ELF \u7684\u51e0\u79cd\u5e38\u89c1\u7c7b\u578b1. \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6 Relocatable File2. \u53ef\u6267\u884c\u6587\u4ef6 Executable File3. \u5171\u4eab\u76ee\u6807\u6587\u4ef6 Shared Object File4. Core dump\u4e94\u3001ELF \u6587\u4ef6\u6574\u4f53\u7531\u54ea\u4e9b\u90e8\u5206\u7ec4\u62101. ELF Header2. Section Header Table3. Program Header Table4. Sections\u516d\u3001\u5e38\u89c1 section \u89e3\u91ca1.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/97679.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-29T16:01:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260829160055-6a9302374a6f5.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97679.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/97679.html\",\"name\":\"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-29T16:01:00+00:00\",\"dateModified\":\"2026-08-29T16:01:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/97679.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/97679.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97679.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/97679.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u76ee\u5f55\u4e00\u3001\u5148\u56de\u987e\u7f16\u8bd1\u548c\u94fe\u63a5\u4e8c\u3001.o \u6587\u4ef6\u662f\u4ec0\u4e48\u4e09\u3001ELF \u662f\u4ec0\u4e48\u56db\u3001ELF \u7684\u51e0\u79cd\u5e38\u89c1\u7c7b\u578b1. \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6 Relocatable File2. \u53ef\u6267\u884c\u6587\u4ef6 Executable File3. \u5171\u4eab\u76ee\u6807\u6587\u4ef6 Shared Object File4. Core dump\u4e94\u3001ELF \u6587\u4ef6\u6574\u4f53\u7531\u54ea\u4e9b\u90e8\u5206\u7ec4\u62101. ELF Header2. Section Header Table3. Program Header Table4. Sections\u516d\u3001\u5e38\u89c1 section \u89e3\u91ca1.","og_url":"https:\/\/www.wsisp.com\/helps\/97679.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-29T16:01:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260829160055-6a9302374a6f5.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/97679.html","url":"https:\/\/www.wsisp.com\/helps\/97679.html","name":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-29T16:01:00+00:00","dateModified":"2026-08-29T16:01:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/97679.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/97679.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/97679.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u516d\uff09\uff1a\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e ELF\uff1a.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u5230\u5e95\u662f\u4ec0\u4e48"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/97679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=97679"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/97679\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/97675"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=97679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=97679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=97679"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=97679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}