{"id":106580,"date":"2026-09-17T18:32:31","date_gmt":"2026-09-17T10:32:31","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/106580.html"},"modified":"2026-09-17T18:32:31","modified_gmt":"2026-09-17T10:32:31","slug":"%e4%bb%8e-o%e5%88%b0elf-%e9%9d%99%e6%80%81%e5%ba%93%e5%8a%a8%e6%80%81%e5%ba%93%e4%b8%8e%e5%8f%af%e6%89%a7%e8%a1%8c%e6%96%87%e4%bb%b6%e7%9a%84%e7%94%9f%e5%91%bd%e5%91%a8%e6%9c%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/106580.html","title":{"rendered":"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f"},"content":{"rendered":"<h2>\u4ece .o \u5230 ELF&#xff1a;\u9759\u6001\u5e93\u3001\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u751f\u547d\u5468\u671f<\/h2>\n<p>\u7cfb\u5217\u7b2c\u4e09\u7bc7&#xff0c;\u65f6\u95f4\u8de8\u5ea6 2026.07.18 \u2013 07.20&#xff0c;\u4e3b\u9898\u6b63\u5f0f\u4ece\u300c\u6587\u4ef6\u7cfb\u7edf\u300d\u8f6c\u5165\u300c\u5e93\u6587\u4ef6\u300d\u3002<br \/>\n\u4e3b\u7ebf\u662f\u4e09\u4e2a\u95ee\u9898&#xff1a;<br \/>\n\u2460 \u5e93\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;\u600e\u4e48\u9020\u3001\u600e\u4e48\u7528\u3001\u94fe\u63a5\u671f\u548c\u8fd0\u884c\u671f\u5206\u522b\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<br \/>\n\u2461 \u4e8c\u8fdb\u5236\u6587\u4ef6\u51ed\u4ec0\u4e48\u80fd\u88ab\u52a0\u8f7d&#xff1f;\u2014\u2014 \u8d70\u8fdb ELF \u683c\u5f0f<br \/>\n\u2462 \u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4ece\u54ea\u6765&#xff1f;\u2014\u2014 Program Header Table \u662f\u90a3\u5f20\u300c\u6bb5\u84dd\u56fe\u300d<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u5e93\u7684\u672c\u8d28&#xff1a;\u4e00\u5806 .o \u7684\u6253\u5305<\/h3>\n<p>\u7f16\u8bd1\u56db\u6b65\u8d70&#xff1a;\u9884\u5904\u7406 \u2192 \u7f16\u8bd1 \u2192 \u6c47\u7f16 \u2192 \u94fe\u63a5\u3002\u6c47\u7f16\u4e4b\u540e\u5f97\u5230 .o&#xff08;\u76ee\u6807\u6587\u4ef6&#xff0c;\u51c6\u786e\u53eb\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff09;&#xff0c;\u5b83\u662f\u300c\u53d8\u6210\u6807\u51c6\u4e8c\u8fdb\u5236\u4e4b\u524d\u7684\u6700\u540e\u4e00\u6b65\u300d\u3002<\/p>\n<p>\u800c\u5e93&#xff0c;\u5c31\u662f\u628a\u4e00\u5806 .o \u6253\u5305\u8d77\u6765&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u9759\u6001\u5e93&#xff1a;ar \u5f52\u6863\u5de5\u5177&#xff0c;\u628a\u5f53\u524d\u76ee\u5f55\u6240\u6709 .o \u6253\u5305<\/span><br \/>\nar <span class=\"token parameter variable\">-rc<\/span> libmystdio.a *.o<\/p>\n<p><span class=\"token comment\"># \u52a8\u6001\u5e93&#xff1a;gcc -shared \u628a\u591a\u4e2a .o \u94fe\u63a5\u6210\u5171\u4eab\u5e93<\/span><br \/>\ngcc <span class=\"token parameter variable\">-shared<\/span> <span class=\"token parameter variable\">-o<\/span> libmystdio.so *.o     <span class=\"token comment\"># \u6bcf\u4e2a .o \u9700\u5148\u7528 -fPIC \u7f16\u8bd1<\/span><\/p>\n<p>\u51e0\u6761\u94c1\u5f8b&#xff1a;<\/p>\n<li>\u547d\u540d\u89c4\u8303&#xff1a;\u5e93\u6587\u4ef6\u540d\u5fc5\u987b\u4ee5 lib \u5f00\u5934\u3001\u4ee5 .a&#xff08;\u9759\u6001&#xff09;\u6216 .so&#xff08;\u52a8\u6001&#xff09;\u7ed3\u5c3e\u2014\u2014\u8fd9\u4e0d\u662f\u8ff7\u4fe1&#xff0c;\u662f -l \u53c2\u6570\u7684\u81ea\u52a8\u8865\u5168\u89c4\u5219\u8981\u6c42\u7684&#xff1b;<\/li>\n<li>\u5e93\u7edd\u5bf9\u4e0d\u80fd\u5305\u542b main \u51fd\u6570&#xff1a;\u4e00\u4e2a\u8fdb\u7a0b\u53ea\u6709\u4e00\u4e2a\u5165\u53e3&#xff0c;main \u5c5e\u4e8e\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u4e0d\u5c5e\u4e8e\u5e93&#xff1b;<\/li>\n<li>\u7ed9\u522b\u4eba\u4ea4\u4ed8\u5e93 &#061; \u5e93\u6587\u4ef6 &#043; \u5934\u6587\u4ef6&#xff1a;\u5934\u6587\u4ef6\u5c31\u662f\u8fd9\u4efd\u5e93\u7684\u300c\u64cd\u4f5c\u624b\u518c\u300d\u3002<\/li>\n<hr \/>\n<h3>\u4e8c\u3001\u9759\u6001\u5e93&#xff1a;\u94fe\u63a5\u671f\u5c31\u300c\u710a\u6b7b\u300d\u8fdb\u53ef\u6267\u884c\u6587\u4ef6<\/h3>\n<p>gcc <span class=\"token parameter variable\">-c<\/span> mystdio.c <span class=\"token parameter variable\">-o<\/span> mystdio.o     <span class=\"token comment\"># \u7f16\u8bd1\u6210 .o<\/span><br \/>\nar <span class=\"token parameter variable\">-rc<\/span> libmystdio.a mystdio.o     <span class=\"token comment\"># \u6253\u5305\u6210\u9759\u6001\u5e93<\/span><\/p>\n<p>gcc <span class=\"token parameter variable\">-o<\/span> main main.c -I.\/include -L.\/lib <span class=\"token parameter variable\">-lmystdio<\/span><\/p>\n<p>\u4f7f\u7528\u65f6\u7684\u4e09\u4e2a\u53c2\u6570&#xff0c;\u5404\u53f8\u5176\u804c&#xff1a;<\/p>\n<table>\n<tr>\u53c2\u6570\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>-I&#xff08;\u5927\u5199 i&#xff09;<\/td>\n<td>\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84&#xff08;\u7f16\u8bd1\u671f\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-L<\/td>\n<td>\u5e93\u6587\u4ef6\u641c\u7d22\u8def\u5f84&#xff08;\u94fe\u63a5\u671f\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-l&#xff08;\u5c0f\u5199 L&#xff09;<\/td>\n<td>\u6307\u5b9a\u5e93\u540d&#xff0c;\u4e0d\u52a0 lib\u3001\u4e0d\u52a0\u540e\u7f00<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e3a\u4ec0\u4e48\u5934\u6587\u4ef6\u4e0d\u7528\u6307\u660e\u8def\u5f84&#xff0c;\u5e93\u5374\u5fc5\u987b\u6307\u660e&#xff1f; \u8fd9\u662f\u521d\u5b66\u65f6\u6700\u522b\u626d\u7684\u4e00\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u5934\u6587\u4ef6\u662f\u4f60\u5728\u4ee3\u7801\u91cc #include \u7684&#xff0c;\u540d\u5b57\u4f60\u5df2\u7ecf\u5199\u6b7b\u4e86&#xff08;#include &#034;mystdio.h&#034;&#xff09;&#xff0c;\u7f16\u8bd1\u5668\u6309 &lt; &gt; \u5148\u7cfb\u7edf\u76ee\u5f55\u3001&#034; &#034; \u5148\u672c\u5730\u518d\u7cfb\u7edf\u3001\u6700\u540e -I \u7684\u987a\u5e8f\u53bb\u627e\u5c31\u884c&#xff1b;<\/li>\n<li>\u800c\u5e93\u6587\u4ef6\u4ee3\u7801\u91cc\u6839\u672c\u6ca1\u63d0\u8fc7\u5b83\u7684\u540d\u5b57&#xff01;\u4e00\u4e2a .o \u96c6\u5408\u7684\u540d\u5b57\u662f\u7528\u6237&#xff08;\u4f60&#xff09;\u8d77\u7684&#xff0c;\u7f16\u8bd1\u5668\u65e0\u4ece\u731c\u6d4b\u300c\u8fd9\u4e2a\u6587\u4ef6\u8be5\u94fe\u8c01\u300d\u2014\u2014\u6240\u4ee5\u5fc5\u987b\u663e\u5f0f\u7ed9 -l\u3002\u800c\u4e14\u540c\u4e00\u4e2a\u8def\u5f84\u4e0b\u53ef\u80fd\u6709\u591a\u4e2a\u5e93&#xff0c;\u4e0d\u6307\u660e\u5c31\u4f1a\u6b67\u4e49\u3002<\/li>\n<\/ul>\n<p>\u9759\u6001\u94fe\u63a5\u7684\u6700\u7ec8\u5f62\u6001&#xff1a;\u5e93\u91cc\u7684\u51fd\u6570\u4ee3\u7801\u88ab\u76f4\u63a5\u590d\u5236\u8fdb main \u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u9759\u6001\u94fe\u63a5\u51fa\u6765\u7684\u7a0b\u5e8f\u4f53\u79ef\u5927&#xff08;\u51e0 MB&#xff09;&#xff0c;\u4f46\u62f7\u5230\u4efb\u4f55\u5730\u65b9\u90fd\u80fd\u8dd1&#xff0c;\u4e0d\u4f9d\u8d56\u5916\u90e8\u5e93\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u52a8\u6001\u5e93&#xff1a;\u94fe\u63a5\u671f\u53ea\u300c\u8bb0\u540d\u5b57\u300d&#xff0c;\u8fd0\u884c\u671f\u624d\u300c\u627e\u5e93\u300d<\/h3>\n<p>gcc <span class=\"token parameter variable\">-fPIC<\/span> <span class=\"token parameter variable\">-c<\/span> mystdio.c <span class=\"token parameter variable\">-o<\/span> mystdio.o   <span class=\"token comment\"># -fPIC&#xff1a;\u751f\u6210\u4f4d\u7f6e\u65e0\u5173\u4ee3\u7801<\/span><br \/>\ngcc <span class=\"token parameter variable\">-shared<\/span> <span class=\"token parameter variable\">-o<\/span> libmystdio.so mystdio.o<br \/>\ngcc <span class=\"token parameter variable\">-o<\/span> main main.c -I.\/include -L.\/lib <span class=\"token parameter variable\">-lmystdio<\/span><br \/>\n.\/main   <span class=\"token comment\"># \u2190 \u7ecf\u5e38\u5728\u8fd9\u91cc\u7ffb\u8f66&#xff1a;\u627e\u4e0d\u5230\u5e93&#xff01;<\/span><\/p>\n<p>-fPIC&#xff08;Position Independent Code&#xff0c;\u4f4d\u7f6e\u65e0\u5173\u4ee3\u7801&#xff09; \u662f\u52a8\u6001\u5e93\u7684\u5173\u952e&#xff1a;\u5e93\u8981\u88ab\u52a0\u8f7d\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u91cc\u4e0d\u786e\u5b9a\u7684\u4f4d\u7f6e&#xff08;\u5171\u4eab\u533a&#xff09;&#xff0c;\u6240\u4ee5\u91cc\u9762\u7684\u4ee3\u7801\u4e0d\u80fd\u5199\u6b7b\u7edd\u5bf9\u5730\u5740&#xff0c;\u5fc5\u987b\u5168\u90e8\u7528\u76f8\u5bf9\u5bfb\u5740\u2014\u2014\u8ba9 .o \u5728\u7f16\u8bd1\u671f\u5c31\u91c7\u7528\u76f8\u5bf9\u5730\u5740\u3002<\/p>\n<h4>3.1 \u4e3a\u4ec0\u4e48\u8fd0\u884c\u65f6\u627e\u4e0d\u5230\u5e93&#xff1f;<\/h4>\n<p>\u56e0\u4e3a\u52a8\u6001\u5e93\u6709\u4e24\u9053\u5173\u5361&#xff0c;\u9759\u6001\u5e93\u53ea\u6709\u4e00\u9053&#xff1a;<\/p>\n<table>\n<tr>\u94fe\u63a5\u671f\u8fd0\u884c\u671f<\/tr>\n<tbody>\n<tr>\n<td>\u9759\u6001\u5e93<\/td>\n<td>\u2705 \u9700\u8981\u5e93\u6587\u4ef6&#xff08;.a&#xff09;<\/td>\n<td>\u274c \u4e0d\u9700\u8981&#xff08;\u5df2\u590d\u5236\u8fdb\u53ef\u6267\u884c\u6587\u4ef6&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u52a8\u6001\u5e93<\/td>\n<td>\u2705 \u9700\u8981\u5e93\u6587\u4ef6&#xff08;\u8bc6\u522b\u540d\u5b57&#xff09;<\/td>\n<td>\u2705 \u8fd8\u9700\u8981\u5e93\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>\u94fe\u63a5\u671f&#xff1a;\u94fe\u63a5\u5668\u628a\u300c\u6211\u7528\u4e86\u54ea\u4e2a\u52a8\u6001\u5e93\u300d\u8fd9\u4e2a\u540d\u5b57\u5199\u8fdb\u53ef\u6267\u884c\u6587\u4ef6\u7684\u4e00\u4e2a\u6bb5\u91cc&#xff08;\u8fd9\u5c31\u662f\u540e\u9762\u8981\u8bb2\u7684 .dynamic \/ DT_NEEDED&#xff09;&#xff1b;<\/li>\n<li>\u8fd0\u884c\u671f&#xff1a;\u7cfb\u7edf\u7684\u52a8\u6001\u52a0\u8f7d\u5668 ld.so \u62ff\u8fd9\u4e2a\u540d\u5b57&#xff0c;\u53bb\u51e0\u4e2a\u9ed8\u8ba4\u8def\u5f84\u67e5\u627e .so&#xff0c;\u627e\u4e0d\u5230\u5c31\u62a5 error while loading shared libraries\u3002<\/li>\n<\/ul>\n<h4>3.2 \u8fd0\u884c\u671f\u627e\u5e93\u7684\u56db\u6761\u8def&#xff08;\u672c\u8d28\u662f\u56db\u5408\u4e00&#xff09;<\/h4>\n<table>\n<tr>\u65b9\u5f0f\u505a\u6cd5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u2460 \u73af\u5883\u53d8\u91cf<\/td>\n<td>LD_LIBRARY_PATH&#061;\/my\/lib<\/td>\n<td>\u6700\u5e38\u7528&#xff0c;\u7b49\u4ef7\u4e8e\u300c\u5e93\u7684 PATH\u300d<\/td>\n<\/tr>\n<tr>\n<td>\u2461 \u7cfb\u7edf\u9ed8\u8ba4\u8def\u5f84<\/td>\n<td>\u628a\u5e93\u62f7\u5230 \/lib64\u3001\/usr\/lib \u7b49<\/td>\n<td>\u6b63\u89c4\u505a\u6cd5&#xff08;\u9700\u8981\u6743\u9650&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u2462 \u914d\u7f6e\u6587\u4ef6<\/td>\n<td>\/etc\/ld.so.conf &#043; ldconfig<\/td>\n<td>\u672c\u8d28\u4ecd\u662f\u65b9\u5f0f\u2460&#xff0c;\u53ea\u662f\u96c6\u4e2d\u767b\u8bb0<\/td>\n<\/tr>\n<tr>\n<td>\u2463 \u8f6f\u94fe\u63a5<\/td>\n<td>\u5728\u9ed8\u8ba4\u76ee\u5f55\u5efa\u8f6f\u94fe\u63a5\u6307\u5411\u771f\u5b9e\u5e93<\/td>\n<td>\u672c\u8d28\u4ecd\u662f\u65b9\u5f0f\u2460&#xff0c;\u8f6f\u94fe\u63a5\u53ea\u5b58\u8def\u5f84\u5b57\u7b26\u4e32<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bb0\u4f4f\u8fd9\u6761\u7c7b\u6bd4&#xff1a;\u6211\u4eec\u6267\u884c\u547d\u4ee4\u9760 PATH \u627e\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u7a0b\u5e8f\u5728\u8fd0\u884c\u671f\u5219\u9760 LD_LIBRARY_PATH \u627e\u52a8\u6001\u5e93\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93\u540c\u65f6\u5b58\u5728&#xff0c;\u7528\u54ea\u4e2a&#xff1f;<\/h3>\n<p>\u7b54\u6848\u5f88\u5e72\u8106&#xff1a;\u6709\u52a8\u6001\u5e93\u5c31\u7528\u52a8\u6001\u5e93&#xff0c;\u6ca1\u6709\u624d\u9000\u56de\u9759\u6001\u5e93\u3002<\/p>\n<p>\u7406\u7531\u662f\u4f53\u79ef\u8d26&#xff1a;\u540c\u4e00\u4efd\u529f\u80fd&#xff0c;\u9759\u6001\u5e93\u7248\u672c\u53ef\u80fd 8000 \u5b57\u8282\u3001\u52a8\u6001\u5e93\u7248\u672c 800000 \u5b57\u8282&#xff08;\u76f8\u5dee\u4e0a\u767e\u500d&#xff09;\u2014\u2014\u52a8\u6001\u5e93\u4ee3\u7801\u53ea\u6709\u4e00\u4efd&#xff0c;\u88ab\u6240\u6709\u8fdb\u7a0b\u5171\u4eab&#xff0c;\u5f53\u7136\u66f4\u5212\u7b97\u3002<\/p>\n<p>\u8981\u5f3a\u5236\u9759\u6001\u94fe\u63a5&#xff0c;\u52a0 -static\u3002<\/p>\n<table>\n<tr>\u9759\u6001\u94fe\u63a5\u52a8\u6001\u94fe\u63a5<\/tr>\n<tbody>\n<tr>\n<td>\u65f6\u673a<\/td>\n<td>\u94fe\u63a5\u671f\u5b8c\u6210\u5168\u90e8\u5de5\u4f5c<\/td>\n<td>\u94fe\u63a5\u671f\u8bb0\u540d\u5b57&#xff0c;\u8fd0\u884c\u671f\u88c5\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u53ef\u6267\u884c\u6587\u4ef6\u4f53\u79ef<\/td>\n<td>\u5927&#xff08;\u542b\u5e93\u4ee3\u7801&#xff09;<\/td>\n<td>\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>\u8fd0\u884c\u671f\u4f9d\u8d56<\/td>\n<td>\u65e0<\/td>\n<td>\u9700\u8981 .so \u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58\/\u78c1\u76d8\u5360\u7528<\/td>\n<td>\u6bcf\u4efd\u7a0b\u5e8f\u5404\u5b58\u4e00\u4efd<\/td>\n<td>\u591a\u8fdb\u7a0b\u5171\u4eab\u4e00\u4efd<\/td>\n<\/tr>\n<tr>\n<td>\u5347\u7ea7\u5e93<\/td>\n<td>\u9700\u91cd\u65b0\u94fe\u63a5\u7a0b\u5e8f<\/td>\n<td>\u6362 .so \u5373\u53ef&#xff08;\u65e0\u9700\u91cd\u7f16&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e94\u3001\u8d70\u8fdb ELF&#xff1a;\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u683c\u5f0f<\/h3>\n<p>\u53ef\u6267\u884c\u6587\u4ef6\u4e0d\u662f\u300c\u968f\u610f\u5806\u5728\u4e00\u8d77\u7684 01\u300d&#xff0c;\u5b83\u6709\u4e25\u683c\u7684\u683c\u5f0f&#xff0c;\u8fd9\u4e2a\u683c\u5f0f\u53eb ELF&#xff08;Executable and Linkable Format&#xff09;\u3002\u4ee5\u4e0b\u90fd\u662f ELF \u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>.o \u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff1b;<\/li>\n<li>\u53ef\u6267\u884c\u6587\u4ef6&#xff08;a.out&#xff09;&#xff1b;<\/li>\n<li>\u52a8\u6001\u5e93 .so&#xff1b;<\/li>\n<li>core dump \u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3\u94fe\u63a5&#xff1a;\u94fe\u63a5\u7684\u672c\u8d28&#xff0c;\u5c31\u662f\u628a\u4e00\u5806 ELF \u5408\u5e76\u4e3a\u4e00\u4e2a ELF\u3002<\/p>\n<h4>5.1 ELF \u7684\u56db\u5927\u7ec4\u6210\u90e8\u5206<\/h4>\n<table>\n<tr>\u7ed3\u6784\u4f5c\u7528\u67e5\u770b\u547d\u4ee4\u7c7b\u6bd4<\/tr>\n<tbody>\n<tr>\n<td>ELF Header<\/td>\n<td>\u63cf\u8ff0\u6574\u4e2a\u6587\u4ef6\u7ed3\u6784&#xff1b;\u6700\u91cd\u8981\u7684\u5b57\u6bb5\u662f Entry Point Address&#xff08;\u5165\u53e3\u5730\u5740&#xff09;<\/td>\n<td>readelf -h<\/td>\n<td>\u78c1\u76d8\u7684 Super Block<\/td>\n<\/tr>\n<tr>\n<td>Section Header Table<\/td>\n<td>\u63cf\u8ff0\u6240\u6709\u8282&#xff08;\u78c1\u76d8\u89c6\u89d2&#xff09;<\/td>\n<td>readelf -S<\/td>\n<td>\u76ee\u5f55\u7d22\u5f15<\/td>\n<\/tr>\n<tr>\n<td>Program Header Table<\/td>\n<td>\u63cf\u8ff0\u6240\u6709\u6bb5&#xff08;\u5185\u5b58\/\u865a\u62df\u5730\u5740\u7a7a\u95f4\u89c6\u89d2&#xff09;<\/td>\n<td>readelf -l<\/td>\n<td>\u6bb5\u84dd\u56fe<\/td>\n<\/tr>\n<tr>\n<td>\u8282\u5185\u5bb9\u672c\u4f53<\/td>\n<td>\u771f\u6b63\u5b58\u653e\u4ee3\u7801\u4e0e\u6570\u636e<\/td>\n<td>\u2014<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e3a\u4ec0\u4e48 ELF \u4e5f\u9700\u8981\u8fd9\u4e48\u4e00\u5957\u300c\u7ba1\u7406\u7ed3\u6784\u300d&#xff1f;\u8ddf\u78c1\u76d8\u4e00\u6a21\u4e00\u6837&#xff1a;\u8981\u7ba1\u7406\u78c1\u76d8\u5c31\u9700\u8981 Super Block \u548c GDT&#xff1b;\u8981\u7ba1\u7406\u8fd9\u4e9b\u8282&#xff0c;\u5c31\u9700\u8981 ELF Header \u548c\u4e24\u5f20 Header Table\u3002 \u5148\u63cf\u8ff0&#xff0c;\u518d\u7ec4\u7ec7\u2014\u2014\u53c8\u4e00\u6b21\u5370\u8bc1\u3002<\/p>\n<h4>5.2 \u5e38\u89c1\u7684\u8282&#xff08;Section&#xff09;<\/h4>\n<table>\n<tr>\u8282\u540d\u5185\u5bb9<\/tr>\n<tbody>\n<tr>\n<td>.text<\/td>\n<td>\u7a0b\u5e8f\u4ee3\u7801&#xff08;\u53ea\u8bfb\u3001\u53ef\u6267\u884c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>.rodata<\/td>\n<td>\u53ea\u8bfb\u5e38\u91cf<\/td>\n<\/tr>\n<tr>\n<td>.data<\/td>\n<td>\u5df2\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf<\/td>\n<\/tr>\n<tr>\n<td>.bss<\/td>\n<td>\u672a\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf&#xff08;\u4e0d\u5360\u6587\u4ef6\u7a7a\u95f4&#xff0c;\u53ea\u5360\u5185\u5b58&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>.symtab<\/td>\n<td>\u7b26\u53f7\u8868&#xff08;\u51fd\u6570\/\u53d8\u91cf\u540d\u4e0e\u5730\u5740\u7684\u5bf9\u5e94&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>.strtab<\/td>\n<td>\u7b26\u53f7\u540d\u5b57\u7b26\u4e32\u8868<\/td>\n<\/tr>\n<tr>\n<td>.shstrtab<\/td>\n<td>\u8282\u540d\u5b57\u7b26\u4e32\u8868<\/td>\n<\/tr>\n<tr>\n<td>.debug*<\/td>\n<td>\u8c03\u8bd5\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>.rela.dyn \/ .plt \/ .init<\/td>\n<td>\u91cd\u5b9a\u4f4d\u3001\u5ef6\u8fdf\u7ed1\u5b9a\u3001\u521d\u59cb\u5316\u7b49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5.3 \u8282&#xff08;Section&#xff09;vs \u6bb5&#xff08;Segment&#xff09;<\/h4>\n<p>\u8fd9\u662f\u6574\u7bc7\u7b14\u8bb0\u6700\u6838\u5fc3\u7684\u4e00\u7ec4\u533a\u5206&#xff1a;<\/p>\n<p>\u8282&#xff0c;\u662f\u63cf\u8ff0 ELF \u78c1\u76d8\u6587\u4ef6\u7684\u6982\u5ff5&#xff1b;\u6bb5&#xff0c;\u662f\u63cf\u8ff0\u5185\u5b58&#xff08;\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4&#xff09;\u7684\u6982\u5ff5\u3002<\/p>\n<p>\u90a3\u4e3a\u4ec0\u4e48\u8981\u6709\u4e24\u5957&#xff1f;\u5173\u952e\u5728\u4e8e\u5185\u5b58\u6bd4\u78c1\u76d8\u73cd\u8d35\u5f97\u591a&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58&#xff08;\u548c\u5916\u5b58 IO&#xff09;\u90fd\u4ee5 4KB \u4e3a\u57fa\u672c\u5355\u4f4d&#xff0c;\u4e00\u6b21\u6362\u5165 4KB&#xff1b;<\/li>\n<li>\u5982\u679c\u6309\u8282\u52a0\u8f7d&#xff0c;.text\u3001.rodata\u3001.data \u8fd9\u4e9b\u5c0f\u8282\u5404\u81ea\u5360\u4e0d\u6ee1\u4e00\u4e2a 4KB&#xff0c;\u4f1a\u9020\u6210\u5927\u91cf\u5185\u90e8\u788e\u7247\u3001\u6d6a\u8d39\u5b9d\u8d35\u7684\u7269\u7406\u5185\u5b58&#xff1b;<\/li>\n<li>\u4e8e\u662f\u52a0\u8f7d\u5668\u628a\u300c\u6743\u9650\u76f8\u540c\u3001\u7c7b\u578b\u76f8\u540c\u300d\u7684\u8282\u5408\u5e76\u6210\u5927\u6bb5&#xff0c;\u51d1\u6ee1 4KB \u7684\u6574\u6570\u500d&#xff0c;\u6700\u5927\u5316\u5185\u5b58\u5229\u7528\u6548\u7387\u3002<\/li>\n<\/ul>\n<p>\u8282&#xff08;\u78c1\u76d8&#xff0c;\u7ec6\u7c92\u5ea6&#xff09;  \u2500\u2500\u5408\u5e76\u89c4\u5219&#xff08;\u6743\u9650\u4e00\u81f4 \/ \u7c7b\u578b\u4e00\u81f4&#xff09;\u2500\u2500\u25b6  \u6bb5&#xff08;\u5185\u5b58&#xff0c;4KB \u5bf9\u9f50&#xff09;<br \/>\n.text &#043; .rodata  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25b6  \u4ee3\u7801\u6bb5&#xff08;r-x&#xff09;<br \/>\n.data &#043; .bss     \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25b6  \u6570\u636e\u6bb5&#xff08;rw-&#xff09;<\/p>\n<p>\u8fd9\u6761\u89c4\u5219\u540c\u65f6\u4e5f\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u4ee3\u7801\u6bb5\u662f\u53ea\u8bfb\u7684&#xff1a;\u5b83\u7531\u4e00\u6279\u53ea\u8bfb\u8282\u5408\u5e76\u800c\u6210&#xff0c;\u6743\u9650\u662f\u5408\u5e76\u65f6\u5c31\u5b9a\u597d\u7684\u3002<\/p>\n<p>\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48 readelf -S \u80fd\u770b\u5230\u51e0\u5341\u4e2a\u8282&#xff0c;\u800c readelf -l \u53ea\u6709\u5be5\u5be5\u51e0\u4e2a\u6bb5\u2014\u2014\u591a\u4e2a\u8282&#xff0c;\u5408\u6210\u4e00\u4e2a\u6bb5\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u91cd\u8c08\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4&#xff1a;\u865a\u62df\u5730\u5740\u662f\u4ece\u54ea\u6765\u7684&#xff1f;<\/h3>\n<h4>6.1 \u5148\u56de\u7b54\u95ee\u9898&#xff1a;\u7a0b\u5e8f\u8fd8\u6ca1\u52a0\u8f7d&#xff0c;\u6709\u6ca1\u6709\u5730\u5740&#xff1f;<\/h4>\n<p>\u6709&#xff01;\u4e00\u5b9a\u6709\u865a\u62df\u5730\u5740\u3002<\/p>\n<ul>\n<li>\u4ee3\u7801\u53cd\u6c47\u7f16\u65f6&#xff0c;\u6bcf\u6761 call \u540e\u9762\u8ddf\u7740\u7684\u5c31\u662f\u51fd\u6570\u5730\u5740\u2014\u2014\u8fd9\u4e9b\u5730\u5740\u662f\u7f16\u8bd1\u5668\u7f16\u51fa\u6765\u7684&#xff1b;<\/li>\n<li>32 \u4f4d\u7cfb\u7edf\u4e0b&#xff0c;\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4ece\u5168 0 \u5230\u5168 1&#xff08;4GB&#xff09;\u5e73\u5766\u7f16\u5740&#xff08;\u5e73\u5766\u6a21\u5f0f &#061; 0 &#043; \u504f\u79fb\u91cf&#xff0c;\u9010\u884c\u7f16\u5740&#xff09;&#xff1b;<\/li>\n<li>\u4f46\u7269\u7406\u5730\u5740\u5fc5\u987b\u7b49\u52a0\u8f7d\u8fdb\u5185\u5b58\u624d\u6709&#xff1a;\u6ca1\u52a0\u8f7d \u2192 \u865a\u62df\u5730\u5740\u5b58\u5728\u3001\u7269\u7406\u5730\u5740\u4e3a 0&#xff08;\u7a7a&#xff09;\u2192 \u4e00\u65e6\u8bbf\u95ee\u89e6\u53d1\u7f3a\u9875\u5f02\u5e38&#xff0c;\u518d\u7531\u5185\u6838\u628a\u4ee3\u7801\u548c\u6570\u636e\u4ece\u78c1\u76d8\u8f7d\u5165\u5e76\u5efa\u7acb\u6620\u5c04\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4e0d\u53ea\u662f\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e8b&#xff0c;\u5b83\u4e00\u534a\u662f\u7f16\u8bd1\u5668\u7684\u6d3b\u3002<\/p>\n<h4>6.2 Program Header Table&#xff1a;\u7f16\u8bd1\u5668\u7559\u4e0b\u7684\u300c\u6bb5\u84dd\u56fe\u300d<\/h4>\n<p>\u521b\u5efa\u8fdb\u7a0b\u7684\u987a\u5e8f\u662f&#xff1a;\u5148\u521b\u5efa PCB\/mm_struct \u7b49\u6570\u636e\u7ed3\u6784&#xff0c;\u518d\u52a0\u8f7d\u6570\u636e\u4e0e\u4ee3\u7801\u3002<\/p>\n<p>\u90a3 struct mm_struct&#xff08;\u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4&#xff09;\u62ff\u4ec0\u4e48\u521d\u59cb\u5316&#xff1f;\u7b54\u6848&#xff1a;<\/p>\n<p>\u8bfb ELF Header  \u2192  \u5b9a\u4f4d Program Header Table<br \/>\n        \u2193  Program Header Table \u91cc\u8bb0\u5f55\u4e86\u6bcf\u4e2a\u6bb5\u7684\u865a\u62df\u5730\u5740\u3001\u6743\u9650\u3001\u5bf9\u9f50\u7b49<br \/>\n\u7528\u8fd9\u4efd\u300c\u6bb5\u84dd\u56fe\u300d\u521d\u59cb\u5316\u8fdb\u7a0b\u7684 mm_struct<br \/>\n        \u2193<br \/>\n\u865a\u62df\u5730\u5740\u7a7a\u95f4\u5c31\u6b64\u5efa\u7acb&#xff08;\u6bb5\u4e0e\u6bb5\u7684\u8fb9\u754c\u3001\u6743\u9650\u5168\u90e8\u5c31\u4f4d&#xff09;<\/p>\n<p>Program Header Table \u662f\u600e\u4e48\u6765\u7684&#xff1f;\u7f16\u8bd1\u5668\u751f\u6210\u7684&#xff1a;\u5b83\u5728\u751f\u6210 ELF \u65f6&#xff0c;\u5df2\u7ecf\u6309\u300c\u6743\u9650 &#043; \u7c7b\u578b\u300d\u7684\u89c4\u5219\u603b\u7ed3\u597d\u4e86\u300c\u54ea\u4e9b\u8282\u5408\u5e76\u6210\u54ea\u4e2a\u6bb5\u3001\u8fd9\u4e2a\u6bb5\u5360\u54ea\u4e9b\u865a\u62df\u5730\u5740\u300d&#xff0c;\u4e8e\u662f\u624d\u6709\u4e86 .text \u6bb5\u7684\u7b2c\u4e00\u4e2a\u865a\u62df\u5730\u5740\u7b49\u4e00\u5806\u5730\u5740\u4fe1\u606f\u3002<\/p>\n<h4>6.3 \u4e00\u5f20\u8868\u8bf4\u6e05\u300c\u8c01\u8bb0\u8f7d\u4e86\u4ec0\u4e48\u300d<\/h4>\n<table>\n<tr>\u9700\u8981\u7684\u4fe1\u606f\u5b58\u5728 ELF \u7684\u54ea\u91cc<\/tr>\n<tbody>\n<tr>\n<td>\u6574\u4e2a\u6587\u4ef6\u7684\u67b6\u6784<\/td>\n<td>ELF Header<\/td>\n<\/tr>\n<tr>\n<td>\u7a0b\u5e8f\u5165\u53e3&#xff08;main \u8d77\u59cb\u865a\u62df\u5730\u5740&#xff09;<\/td>\n<td>ELF Header \u7684 Entry Point Address<\/td>\n<\/tr>\n<tr>\n<td>\u4ee3\u7801\u4e0e\u6570\u636e\u672c\u4f53<\/td>\n<td>\u8282&#xff08;Section&#xff09; \u91cc<\/td>\n<\/tr>\n<tr>\n<td>\u6bb5\u7684\u865a\u62df\u5730\u5740\u84dd\u56fe&#xff08;mm_struct \u7684\u6765\u6e90&#xff09;<\/td>\n<td>Program Header Table<\/td>\n<\/tr>\n<tr>\n<td>\u7528\u4e86\u54ea\u4e9b\u52a8\u6001\u5e93<\/td>\n<td>.dynamic \u6bb5&#xff08;\u94fe\u63a5\u5668\u5199\u5165&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.4 CPU \u4ece\u54ea\u5f00\u59cb\u6267\u884c&#xff1f;<\/h4>\n<li>\u5185\u6838\u628a Entry Point Address \u5199\u8fdb PC \/ RIP \u5bc4\u5b58\u5668\u2014\u2014\u5b83\u5c31\u662f .text \u6bb5\u7684\u7b2c\u4e00\u4e2a\u865a\u62df\u5730\u5740&#xff1b;<\/li>\n<li>CPU \u6309 RIP \u53d6\u6307\u6267\u884c&#xff0c;call \u628a\u4e0b\u4e00\u4e2a\u51fd\u6570\u7684\u8d77\u59cb\u865a\u62df\u5730\u5740\u53d6\u6765&#xff0c;rip \u8ba1\u6570\u5668\u52a0\u4e0a\u6307\u4ee4\u957f\u5ea6\u7ee7\u7eed\u5f80\u4e0b\u8d70&#xff0c;\u538b\u6808\u4fdd\u5b58\u8fd4\u56de\u5730\u5740&#xff1b;<\/li>\n<li>\u53d6\u5230\u7684\u59cb\u7ec8\u662f\u865a\u62df\u5730\u5740&#xff0c;\u4ea4\u7ed9\u786c\u4ef6 MMU&#xff1b;<\/li>\n<li>MMU \u901a\u8fc7 CR3 \u5bc4\u5b58\u5668\u627e\u5230\u5f53\u524d\u8fdb\u7a0b\u7684\u9875\u8868&#xff0c;\u628a\u865a\u62df\u5730\u5740\u7ffb\u8bd1\u6210\u7269\u7406\u5730\u5740&#xff1b;<\/li>\n<li>32 \u6839\u5730\u5740\u603b\u7ebf\u8fdb\u53bb\u3001\u51fa\u6765&#xff0c;CPU \u62ff\u5230\u771f\u6b63\u7684\u7269\u7406\u5730\u5740\u53bb\u53d6\u6570\u636e\u3002<\/li>\n<p>\u8fd9\u5c31\u662f\u865a\u62df\u5730\u5740\u7a7a\u95f4\u843d\u5730\u4e3a\u7269\u7406\u5185\u5b58\u7684\u5b8c\u6574\u95ed\u73af\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u52a8\u6001\u5e93\u662f\u600e\u4e48\u52a0\u8f7d\u7684&#xff1f;<\/h3>\n<p>\u6700\u540e\u4e00\u73af&#xff1a;\u52a8\u6001\u5e93\u88ab\u52a0\u8f7d\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u7684\u54ea\u91cc&#xff1f;<\/p>\n<p>\u52a0\u8f7d\u5230 \u5171\u4eab\u533a&#xff08;mmap \u533a&#xff09;\u3002<\/p>\n<p>\u6b63\u56e0\u4e3a\u5728\u5171\u4eab\u533a&#xff0c;\u540c\u4e00\u4e2a libc.so \u7684\u7269\u7406\u5185\u5b58\u9875\u53ef\u4ee5\u88ab\u6210\u767e\u4e0a\u5343\u4e2a\u8fdb\u7a0b\u5171\u540c\u6620\u5c04\u2014\u2014\u8fd9\u5c31\u662f\u52a8\u6001\u5e93\u53c8\u53eb \u5171\u4eab\u5e93&#xff08;Shared Object&#xff0c;.so&#xff09; \u7684\u539f\u56e0&#xff0c;\u4e5f\u662f\u5b83\u8282\u7701\u5185\u5b58\u7684\u6839\u6e90\u3002<\/p>\n<p>\u800c\u4e0d\u8bba\u662f\u52a8\u6001\u5e93\u8fd8\u662f\u53ef\u6267\u884c\u6587\u4ef6&#xff1a;<\/p>\n<li>\u865a\u62df\u5730\u5740\u5728 ELF \u91cc&#xff08;Program Header Table&#xff09;&#xff1b;<\/li>\n<li>\u4ee3\u7801\u548c\u6570\u636e\u5728\u8282&#xff08;Section&#xff09;\u91cc&#xff1b;<\/li>\n<li>\u5165\u53e3\u5730\u5740\u5728 ELF Header \u91cc&#xff1b;<\/li>\n<li>\u6ca1\u52a0\u8f7d\u65f6\u7269\u7406\u5730\u5740\u4e3a\u7a7a&#xff0c;\u8bbf\u95ee\u5373\u89e6\u53d1\u5f02\u5e38&#xff08;\u7f3a\u9875&#xff09;&#xff0c;\u5185\u6838\u636e\u6b64\u628a\u5bf9\u5e94\u5185\u5bb9\u4ece\u78c1\u76d8\u8f7d\u5165\u3002<\/li>\n<p>\u987a\u4fbf\u56de\u6263\u6587\u4ef6\u7cfb\u7edf&#xff1a;\u7f3a\u9875\u65f6\u5185\u6838\u8981\u627e\u5230\u300c\u6587\u4ef6\u7684\u7b2c\u51e0\u4e2a\u5757\u300d&#xff0c;\u8d70\u7684\u6b63\u662f\u6211\u4eec\u524d\u9762\u5b66\u7684\u90a3\u6761\u94fe\u2014\u2014\u8def\u5f84\u7f13\u5b58\u62ff inode \u2192 inode \u7684 i_block[] \u7b97\u5757\u53f7 \u2192 \u8bfb\u78c1\u76d8\u3002\u4e24\u5957\u77e5\u8bc6\u5728\u8fd9\u91cc\u5408\u6d41\u4e86\u3002<\/p>\n<hr \/>\n<h3>\u516b\u3001\u5c0f\u7ed3<\/h3>\n<p>.c \u2500\u2500\u7f16\u8bd1\u2500\u2500\u25b6 .o&#xff08;\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff0c;ELF&#xff09;<br \/>\n.o \u2500\u2500ar\u2500\u2500\u25b6 .a&#xff08;\u9759\u6001\u5e93&#xff09;        \u2500\u2500\u94fe\u63a5\u671f\u590d\u5236\u8fdb\u53ef\u6267\u884c\u6587\u4ef6\u2500\u2500\u25b6 \u65e0\u8fd0\u884c\u671f\u4f9d\u8d56&#xff0c;\u4f53\u79ef\u5927<br \/>\n.o \u2500\u2500shared&#043;fPIC\u2500\u2500\u25b6 .so&#xff08;\u5171\u4eab\u5e93&#xff09;\u2500\u2500\u94fe\u63a5\u671f\u53ea\u8bb0\u540d\u5b57\u3001\u8fd0\u884c\u671f\u7531 ld.so \u627e\u2500\u2500\u25b6 \u4f53\u79ef\u5c0f\u3001\u53ef\u5171\u4eab<br \/>\n\u4e00\u5806 ELF \u2500\u2500\u94fe\u63a5\u2500\u2500\u25b6 \u4e00\u4e2a ELF&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;<br \/>\n\u53ef\u6267\u884c\u6587\u4ef6 \u2500\u2500\u52a0\u8f7d\u2500\u2500\u25b6 \u6309 Program Header Table \u7684\u6bb5\u84dd\u56fe\u5efa mm_struct<br \/>\n                    \u2192 Entry Point \u5165 RIP \u2192 MMU \u7ffb\u8bd1 \u2192 \u771f\u6b63\u8dd1\u8d77\u6765<\/p>\n<p>\u56db\u6761\u6700\u503c\u5f97\u8bb0\u4f4f\u7684\u7ed3\u8bba&#xff1a;<\/p>\n<li>\u5e93\u662f .o \u7684\u6253\u5305&#xff0c;lib \u524d\u7f00 &#043; \u540e\u7f00\u662f -l \u81ea\u52a8\u8865\u5168\u7684\u89c4\u5219&#xff1b;<\/li>\n<li>\u94fe\u63a5\u671f vs \u8fd0\u884c\u671f&#xff1a;\u9759\u6001\u5e93\u53ea\u5173\u5fc3\u94fe\u63a5\u671f&#xff0c;\u52a8\u6001\u5e93\u4e24\u671f\u90fd\u8981\u7ba1&#xff0c;\u8fd0\u884c\u671f\u9760 LD_LIBRARY_PATH \u8fd9\u4e00\u5957&#xff1b;<\/li>\n<li>\u8282\u662f\u78c1\u76d8\u7684\u3001\u6bb5\u662f\u5185\u5b58\u7684&#xff0c;\u5408\u5e76\u89c4\u5219\u662f\u300c\u6743\u9650\u76f8\u540c\u300d&#xff0c;\u76ee\u7684\u662f\u586b\u6ee1 4KB \u9875&#xff1b;<\/li>\n<li>\u865a\u62df\u5730\u5740\u6765\u81ea ELF&#xff0c;\u7269\u7406\u5730\u5740\u6765\u81ea\u52a0\u8f7d&#xff1b;mm_struct \u662f Program Header Table \u5582\u51fa\u6765\u7684\u3002<\/li>\n<hr \/>\n<p>\u672c\u6587\u57fa\u4e8e 2026-07-18 ~ 07-20 \u7684\u5b66\u4e60\u7b14\u8bb0&#xff08;\u9759\u6001\u5e93\/\u52a8\u6001\u5e93\u751f\u6210\u3001\u52a8\u9759\u6001\u5e93\u53cc\u5411\u3001\u76ee\u6807\u6587\u4ef6 ELF\u3001Program Header Table \u6765\u6e90\u673a\u5236\u3001\u56de\u5f52\u52a8\u6001\u5e93\u52a0\u8f7d&#xff09;\u6574\u7406\u3002\u540e\u7eed\u7b14\u8bb0&#xff08;7.21 ELF \u52a8\u6001\u5e93\u30017.28 \u52a8\u6001\u5e93\u4e3a\u4ec0\u4e48\u662f\u5171\u4eab\u7684&#xff09;\u7ee7\u7eed\u6df1\u5165\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece .o \u5230 ELF&#xff1a;\u9759\u6001\u5e93\u3001\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u751f\u547d\u5468\u671f\u7cfb\u5217\u7b2c\u4e09\u7bc7&#xff0c;\u65f6\u95f4\u8de8\u5ea6 2026.07.18 \u2013 07.20&#xff0c;\u4e3b\u9898\u6b63\u5f0f\u4ece\u300c\u6587\u4ef6\u7cfb\u7edf\u300d\u8f6c\u5165\u300c\u5e93\u6587\u4ef6\u300d\u3002<br \/>\n\u4e3b\u7ebf\u662f\u4e09\u4e2a\u95ee\u9898&#xff1a;<br \/>\n\u2460 \u5e93\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;\u600e\u4e48\u9020\u3001\u600e\u4e48\u7528\u3001\u94fe\u63a5\u671f\u548c\u8fd0\u884c\u671f\u5206\u522b\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<br \/>\n\u2461 \u4e8c\u8fdb\u5236\u6587\u4ef6\u51ed\u4ec0\u4e48\u80fd\u88ab\u52a0\u8f7d&#xff1f;\u2014\u2014 \u8d70\u8fdb ELF \u683c\u5f0f<br \/>\n\u2462 \u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4ece\u54ea\u6765&#xff1f;\u2014\u2014 Program Header <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11653,58],"topic":[],"class_list":["post-106580","post","type-post","status-publish","format-standard","hentry","category-server","tag-11653","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f - \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\/106580.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4ece .o \u5230 ELF&#xff1a;\u9759\u6001\u5e93\u3001\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u751f\u547d\u5468\u671f\u7cfb\u5217\u7b2c\u4e09\u7bc7&#xff0c;\u65f6\u95f4\u8de8\u5ea6 2026.07.18 \u2013 07.20&#xff0c;\u4e3b\u9898\u6b63\u5f0f\u4ece\u300c\u6587\u4ef6\u7cfb\u7edf\u300d\u8f6c\u5165\u300c\u5e93\u6587\u4ef6\u300d\u3002 \u4e3b\u7ebf\u662f\u4e09\u4e2a\u95ee\u9898&#xff1a; \u2460 \u5e93\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;\u600e\u4e48\u9020\u3001\u600e\u4e48\u7528\u3001\u94fe\u63a5\u671f\u548c\u8fd0\u884c\u671f\u5206\u522b\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f; \u2461 \u4e8c\u8fdb\u5236\u6587\u4ef6\u51ed\u4ec0\u4e48\u80fd\u88ab\u52a0\u8f7d&#xff1f;\u2014\u2014 \u8d70\u8fdb ELF \u683c\u5f0f \u2462 \u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4ece\u54ea\u6765&#xff1f;\u2014\u2014 Program Header\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/106580.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-17T10:32:31+00:00\" \/>\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\/106580.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/106580.html\",\"name\":\"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-17T10:32:31+00:00\",\"dateModified\":\"2026-09-17T10:32:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/106580.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/106580.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/106580.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f\"}]},{\"@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":"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f - \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\/106580.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4ece .o \u5230 ELF&#xff1a;\u9759\u6001\u5e93\u3001\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u751f\u547d\u5468\u671f\u7cfb\u5217\u7b2c\u4e09\u7bc7&#xff0c;\u65f6\u95f4\u8de8\u5ea6 2026.07.18 \u2013 07.20&#xff0c;\u4e3b\u9898\u6b63\u5f0f\u4ece\u300c\u6587\u4ef6\u7cfb\u7edf\u300d\u8f6c\u5165\u300c\u5e93\u6587\u4ef6\u300d\u3002 \u4e3b\u7ebf\u662f\u4e09\u4e2a\u95ee\u9898&#xff1a; \u2460 \u5e93\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;\u600e\u4e48\u9020\u3001\u600e\u4e48\u7528\u3001\u94fe\u63a5\u671f\u548c\u8fd0\u884c\u671f\u5206\u522b\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f; \u2461 \u4e8c\u8fdb\u5236\u6587\u4ef6\u51ed\u4ec0\u4e48\u80fd\u88ab\u52a0\u8f7d&#xff1f;\u2014\u2014 \u8d70\u8fdb ELF \u683c\u5f0f \u2462 \u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4ece\u54ea\u6765&#xff1f;\u2014\u2014 Program Header","og_url":"https:\/\/www.wsisp.com\/helps\/106580.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-17T10:32:31+00:00","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\/106580.html","url":"https:\/\/www.wsisp.com\/helps\/106580.html","name":"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-17T10:32:31+00:00","dateModified":"2026-09-17T10:32:31+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/106580.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/106580.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/106580.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece.o\u5230ELF-\u9759\u6001\u5e93\u52a8\u6001\u5e93\u4e0e\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f"}]},{"@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\/106580","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=106580"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/106580\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=106580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=106580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=106580"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=106580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}