{"id":42818,"date":"2025-06-10T08:56:32","date_gmt":"2025-06-10T00:56:32","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/42818.html"},"modified":"2025-06-10T08:56:32","modified_gmt":"2025-06-10T00:56:32","slug":"%e7%a8%8b%e5%ba%8f%e4%ba%ba%e7%94%9f-hellos-p2p-3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/42818.html","title":{"rendered":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P"},"content":{"rendered":"<h3 id=\"Hello%E7%9A%84%E2%80%9C%E8%87%AA%E7%99%BD%E2%80%9D\">Hello\u7684\u201c\u81ea\u767d\u201d<\/h3>\n<p>\u4ffa\u662fHello&#xff0c;\u989d\u2026\u2026\u662f\u6bcf\u4e00\u4e2a\u7a0b\u5e8f\u733f\u00a4\u7684\u521d\u604b&#xff08;\u7f9e\u7f9e\u2026\u2026&#xff09;<\/p>\n<\/p>\n<p>\u5374\u5728\u77ed\u77ed\u51e0\u5206\u949f\u540e\u60e8\u906d\u6bcf\u4e2a\u83dc\u9e1f\u7684\u65e0\u60c5\u629b\u5f03&#xff08;\u545c\u545c\u2026\u2026&#xff09;&#xff0c;\u4ed6\u4eec\u5f88\u5feb\u559c\u6b22\u4e0asum\u3001sort\u3001matrix\u3001PR\u3001AI\u3001IOT\u3001BD\u3001MIS\u2026\u2026&#xff0c;\u4ece\u4e0d\u56de\u5934\u3002<\/p>\n<\/p>\n<p>\u53ea\u6709\u6211\u81ea\u5df1\u77e5\u9053&#xff0c;\u6211\u7684\u51fa\u8eab\u6709\u591a\u4e48\u9ad8\u8d35&#xff0c;\u6211\u7684\u4e00\u751f\u591a\u4e48\u574e\u5777&#xff01;<\/p>\n<\/p>\n<p>\u591a\u5e74\u4ee5\u540e&#xff0c;\u90a3\u4e9b\u771f\u6b63\u61c2\u6211\u7684\u5927\u4f6c&#xff08;\u4e5f\u662f\u66fe\u7ecf\u7684\u83dc\u9e1f\u4e00\u679a&#xff09;&#xff0c;\u624d\u604d\u7136\u611f\u609f\u6211\u7684\u4f1f\u5927&#xff01;<\/p>\n<\/p>\n<p>\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u60f3\u5f53\u5e74&#xff1a; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4ffa\u624d\u662f\u7b2c\u4e00\u4e2a\u73a9 P2P\u7684&#xff08;From Program to Process&#xff09;<\/p>\n<\/p>\n<p>\u61f5\u61f5\u61c2\u61c2\u7684\u4f60\u7b28\u7b28\u78d5\u78d5\u7684\u5c06\u6211\u4e00\u5b57\u4e00\u952e\u6572\u8fdb\u7535\u8111\u5b58\u6210hello.c&#xff08;Program&#xff09;&#xff0c;\u65e0\u610f\u8bc6\u4e2d\u5c06\u6211\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5&#xff0c;\u5386\u7ecf\u8270\u8f9b-\u795e\u79d8-\u9ad8\u8d35-\u6b23\u559c&#xff0c;\u6211\u2014\u2014Hello&#xff0c;\u4e00\u4e2a\u5b8c\u7f8e\u7684\u751f\u547d\u8bde\u751f\u4e86\u3002<\/p>\n<\/p>\n<p>\u4f60\u9020\u5417&#xff1f;\u5728\u58f3(Bash)\u91cc&#xff0c;\u4f1f\u5927\u7684OS&#xff08;\u8fdb\u7a0b\u7ba1\u7406&#xff09;\u4e3a\u6211fork&#xff08;Process&#xff09;&#xff0c;\u4e3a\u6211execve&#xff0c;\u4e3a\u6211mmap&#xff0c;\u5206\u6211\u65f6\u95f4\u7247&#xff0c;\u8ba9\u6211\u5f97\u4ee5\u5728Hardware(CPU\/RAM\/IO)\u4e0a\u9a70\u9a8b&#xff08;\u53d6\u6307\u3001\u8bd1\u7801\u3001\u6267\u884c\u3001\u6d41\u6c34\u7ebf\u7b49&#xff09;&#xff1b;<\/p>\n<\/p>\n<p>\u4f60\u9020\u5417&#xff1f;OS&#xff08;\u5b58\u50a8\u7ba1\u7406&#xff09;\u4e0eMMU\u4e3aVA\u5230PA\u64cd\u788e\u4e86\u5fc3&#xff1b;TLB\u30014\u7ea7\u9875\u8868\u30013\u7ea7Cache&#xff0c;Pagefile\u7b49\u7b49\u5404\u663e\u795e\u901a\u4e3a\u6211\u52a0\u901f&#xff1b;IO\u7ba1\u7406\u4e0e\u4fe1\u53f7\u5904\u7406\u4f7f\u5c3d\u4e86\u6d51\u8eab\u89e3\u6570&#xff0c;\u8f6f\u786c\u7ed3\u5408&#xff0c;\u624d\u4f7f\u6211\u80fd\u5728\u952e\u76d8\u3001\u4e3b\u677f\u3001\u663e\u5361\u3001\u5c4f\u5e55\u95f4\u6e38\u5203\u6709\u4f59&#xff0c;\u867d\u7136\u6211\u5728\u53f0\u4e0a\u7684\u8868\u6f14\u53ea\u662f\u4e00\u77ac\u95f4\u3001\u6f14\u6280\u770b\u8d77\u6765\u5f88Low\u3001\u6548\u679c\u5f88\u60e8\u767d\u3002<\/p>\n<\/p>\n<p>\u611f\u8c22 OS&#xff01;\u611f\u8c22 Bash&#xff01;\u5728\u6211\u5b8c\u7f8e\u8c22\u5e55\u540e\u4e3a\u6211\u6536\u5c38\u3002 \u00a0<\/p>\n<\/p>\n<p>\u6211\u8d64\u6761\u6761\u6765\u53bb\u65e0\u7275\u6302&#xff01; \u6211\u671d CS&#xff08;\u8ba1\u7b97\u673a\u7cfb\u7edf\u2014\u2014Editor&#043;Cpp&#043;Compiler&#043;AS&#043;LD &#043; OS &#043; CPU\/RAM\/IO\u7b49&#xff09;\u6325\u4e00\u6325\u624b&#xff0c;\u4e0d\u5e26\u8d70\u4e00\u7247\u4e91\u5f69&#xff01;<\/p>\n<\/p>\n<p>\u60f3\u60f3\u4ffa\u4e5f\u662f O2O&#xff08;From Zero-0 to Zero-0&#xff09;\u3002 \u5386\u53f2\u957f\u6cb3\u4e2d\u4e00\u4e2a\u4e2a\u83dc\u9e1f\u4e0e\u6211\u64e6\u80a9\u800c\u8fc7&#xff0c;\u53ea\u6709CS\u77e5\u9053\u6211\u7684\u751f\u3001\u6211\u7684\u6b7b&#xff0c;\u6211\u7684\u574e\u5777&#xff0c;\u201c\u53ea\u6709 CS \u77e5\u9053\u2026\u2026\u6211\u66fe\u7ecf\u2026\u2026\u6765\u2026\u2026\u2026\u2026\u8fc7\u2026\u2026\u201d<\/p>\n<h2 id=\"%E7%A8%8B%E5%BA%8F%E4%BA%BA%E7%94%9F-Hello%E2%80%99s%20P2P%E2%80%94%E2%80%94%E5%93%88%E5%B0%94%E6%BB%A8%E5%B7%A5%E4%B8%9A%E5%A4%A7%E5%AD%A6CSAPP%E7%BB%93%E8%AF%BE%E4%BD%9C%E4%B8%9A\" style=\"text-align:center\">\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P\u2014\u2014\u54c8\u5c14\u6ee8\u5de5\u4e1a\u5927\u5b66CSAPP\u7ed3\u8bfe\u4f5c\u4e1a<\/h2>\n<h3 id=\"%E6%91%98%E8%A6%81\" style=\"text-align:center\">\u6458\u8981<\/h3>\n<p>\u672c\u6587\u8ddf\u968fhello.c\u7a0b\u5e8f&#xff0c;\u8d70\u8fc7\u4e86\u5b83\u4ece\u8bde\u751f\u5230\u88ab\u8fd0\u884c\u5230\u7ec8\u6b62\u7684\u6574\u4e2a\u201c\u4eba\u751f\u201d\u3002\u8fd9\u201c\u4e00\u751f\u201d\u5305\u62echello.c\u7a0b\u5e8f\u7684\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5\u3001shell\u547d\u4ee4\u884c\u8f93\u5165\u3001fork\u3001execve\u3001\u8fd0\u884c\u76f4\u5230\u7ec8\u6b62\u3002\u4f7f\u7528gcc\u3001gdb\u3001edb\u3001objdump\u3001readelf\u7b49\u5f00\u53d1\u8c03\u8bd5\u5de5\u5177&#xff0c;\u53bb\u89e3\u8bfb\u4e86hello\u7a0b\u5e8f\u7684\u201c\u4e00\u4e16\u6d6e\u6c89\u201d\u3002\u4ecehello\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u4e2d&#xff0c;\u6211\u4eec\u4f1a\u6536\u83b7\u5b83\u4e0d\u65ad\u6f14\u53d8\u7684\u89c4\u5219&#xff0c;\u5206\u6790\u8ba1\u7b97\u673a\u4e00\u6b65\u4e00\u6b65\u5904\u7406hello.c\u6e90\u6587\u4ef6\u7684\u539f\u7406\u3002\u6700\u540e&#xff0c;\u6211\u4eec\u6f14\u793a\u4e86\u5176\u4e2d\u4e00\u4e9b\u73af\u8282\u7684\u64cd\u4f5c\u548c\u7ed3\u679c&#xff0c;\u6765\u501f\u52a9hello\u953b\u70bc\u6211\u4eec\u7684\u8ba1\u7b97\u673a\u7cfb\u7edf\u601d\u7ef4&#xff01;<\/p>\n<p>\u5173\u952e\u8bcd&#xff1a;hello&#xff1b;\u8ba1\u7b97\u673a\u7cfb\u7edf&#xff1b;\u751f\u547d\u5468\u671f<\/p>\n<hr \/>\n<h3 id=\"main-toc\" style=\"text-align:center\">\u76ee\u5f55<\/h3>\n<p id=\"Hello%E7%9A%84%E2%80%9C%E8%87%AA%E7%99%BD%E2%80%9D-toc\" style=\"margin-left:40px\">Hello\u7684\u201c\u81ea\u767d\u201d<\/p>\n<p id=\"%E7%A8%8B%E5%BA%8F%E4%BA%BA%E7%94%9F-Hello%E2%80%99s%20P2P%E2%80%94%E2%80%94%E5%93%88%E5%B0%94%E6%BB%A8%E5%B7%A5%E4%B8%9A%E5%A4%A7%E5%AD%A6CSAPP%E7%BB%93%E8%AF%BE%E4%BD%9C%E4%B8%9A-toc\" style=\"margin-left:0px\">\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P\u2014\u2014\u54c8\u5c14\u6ee8\u5de5\u4e1a\u5927\u5b66CSAPP\u7ed3\u8bfe\u4f5c\u4e1a<\/p>\n<p id=\"%E6%91%98%E8%A6%81-toc\" style=\"margin-left:40px\">\u6458\u8981<\/p>\n<p id=\"%E7%AC%AC1%E7%AB%A0%20%E6%A6%82%E8%BF%B0-toc\" style=\"margin-left:40px\">\u7b2c1\u7ae0 \u6982\u8ff0<\/p>\n<p id=\"1.1%20Hello%E7%AE%80%E4%BB%8B-toc\" style=\"margin-left:80px\">1.1 Hello\u7b80\u4ecb<\/p>\n<p id=\"1.2%20%E7%8E%AF%E5%A2%83%E4%B8%8E%E5%B7%A5%E5%85%B7-toc\" style=\"margin-left:80px\">1.2 \u73af\u5883\u4e0e\u5de5\u5177<\/p>\n<p id=\"1.3%20%E4%B8%AD%E9%97%B4%E7%BB%93%E6%9E%9C-toc\" style=\"margin-left:80px\">1.3 \u4e2d\u95f4\u7ed3\u679c<\/p>\n<p id=\"1.4%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">1.4 \u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%AC%AC2%E7%AB%A0%20%E9%A2%84%E5%A4%84%E7%90%86-toc\" style=\"margin-left:40px\">\u7b2c2\u7ae0 \u9884\u5904\u7406<\/p>\n<p id=\"2.1%20%E9%A2%84%E5%A4%84%E7%90%86%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">2.1 \u9884\u5904\u7406\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/p>\n<p id=\"2.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E9%A2%84%E5%A4%84%E7%90%86%E7%9A%84%E5%91%BD%E4%BB%A4-toc\" style=\"margin-left:80px\">2.2 \u5728Ubuntu\u4e0b\u9884\u5904\u7406\u7684\u547d\u4ee4<\/p>\n<p id=\"2.3%20Hello%E7%9A%84%E9%A2%84%E5%A4%84%E7%90%86%E7%BB%93%E6%9E%9C%E8%A7%A3%E6%9E%90-toc\" style=\"margin-left:80px\">2.3 Hello\u7684\u9884\u5904\u7406\u7ed3\u679c\u89e3\u6790<\/p>\n<p id=\"2.4%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">2.4 \u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%AC%AC3%E7%AB%A0%20%E7%BC%96%E8%AF%91-toc\" style=\"margin-left:40px\">\u7b2c3\u7ae0 \u7f16\u8bd1<\/p>\n<p id=\"3.1%20%E7%BC%96%E8%AF%91%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">3.1 \u7f16\u8bd1\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/p>\n<p id=\"3.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E7%BC%96%E8%AF%91%E7%9A%84%E5%91%BD%E4%BB%A4-toc\" style=\"margin-left:80px\">3.2 \u5728Ubuntu\u4e0b\u7f16\u8bd1\u7684\u547d\u4ee4<\/p>\n<p id=\"3.3%20Hello%E7%9A%84%E7%BC%96%E8%AF%91%E7%BB%93%E6%9E%9C%E8%A7%A3%E6%9E%90-toc\" style=\"margin-left:80px\">3.3 Hello\u7684\u7f16\u8bd1\u7ed3\u679c\u89e3\u6790<\/p>\n<p id=\"3.3.1%20%E6%95%B0%E6%8D%AE-toc\" style=\"margin-left:120px\">3.3.1 \u6570\u636e<\/p>\n<p id=\"3.3.2%20%E8%B5%8B%E5%80%BC-toc\" style=\"margin-left:120px\">3.3.2 \u8d4b\u503c<\/p>\n<p id=\"3.3.3%20%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2-toc\" style=\"margin-left:120px\">3.3.3 \u7c7b\u578b\u8f6c\u6362<\/p>\n<p id=\"3.3.4%20%E7%AE%97%E6%9C%AF%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:120px\">3.3.4 \u7b97\u672f\u64cd\u4f5c<\/p>\n<p id=\"3.3.5%20%E5%85%B3%E7%B3%BB%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:120px\">3.3.5 \u5173\u7cfb\u64cd\u4f5c<\/p>\n<p id=\"3.3.6%20%E6%8C%87%E9%92%88%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:120px\">3.3.6 \u6307\u9488\u64cd\u4f5c<\/p>\n<p id=\"3.3.7%20%E6%8E%A7%E5%88%B6%E8%BD%AC%E7%A7%BB-toc\" style=\"margin-left:120px\">3.3.7 \u63a7\u5236\u8f6c\u79fb<\/p>\n<p id=\"3.3.8%20%E5%87%BD%E6%95%B0%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:120px\">3.3.8 \u51fd\u6570\u64cd\u4f5c<\/p>\n<p id=\"3.4%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">3.4 \u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%AC%AC4%E7%AB%A0%20%E6%B1%87%E7%BC%96-toc\" style=\"margin-left:40px\">\u7b2c4\u7ae0 \u6c47\u7f16<\/p>\n<p id=\"4.1%20%E6%B1%87%E7%BC%96%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">4.1 \u6c47\u7f16\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/p>\n<p id=\"4.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E6%B1%87%E7%BC%96%E7%9A%84%E5%91%BD%E4%BB%A4-toc\" style=\"margin-left:80px\">4.2 \u5728Ubuntu\u4e0b\u6c47\u7f16\u7684\u547d\u4ee4<\/p>\n<p id=\"4.3%20%E5%8F%AF%E9%87%8D%E5%AE%9A%E4%BD%8D%E7%9B%AE%E6%A0%87elf%E6%A0%BC%E5%BC%8F-toc\" style=\"margin-left:80px\">4.3 \u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807elf\u683c\u5f0f<\/p>\n<p id=\"4.4%20Hello.o%E7%9A%84%E7%BB%93%E6%9E%9C%E8%A7%A3%E6%9E%90-toc\" style=\"margin-left:80px\">4.4 Hello.o\u7684\u7ed3\u679c\u89e3\u6790<\/p>\n<p id=\"4.5%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">4.5 \u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%AC%AC5%E7%AB%A0%20%E9%93%BE%E6%8E%A5-toc\" style=\"margin-left:40px\">\u7b2c5\u7ae0 \u94fe\u63a5<\/p>\n<p id=\"5.1%20%E9%93%BE%E6%8E%A5%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">5.1 \u94fe\u63a5\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/p>\n<p id=\"5.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E9%93%BE%E6%8E%A5%E7%9A%84%E5%91%BD%E4%BB%A4-toc\" style=\"margin-left:80px\">5.2 \u5728Ubuntu\u4e0b\u94fe\u63a5\u7684\u547d\u4ee4<\/p>\n<p id=\"5.3%20%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6hello%E7%9A%84%E6%A0%BC%E5%BC%8F-toc\" style=\"margin-left:80px\">5.3 \u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6hello\u7684\u683c\u5f0f<\/p>\n<p id=\"5.4%20hello%E7%9A%84%E8%99%9A%E6%8B%9F%E5%9C%B0%E5%9D%80%E7%A9%BA%E9%97%B4-toc\" style=\"margin-left:80px\">5.4 hello\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4<\/p>\n<p id=\"5.5%20%E9%93%BE%E6%8E%A5%E7%9A%84%E9%87%8D%E5%AE%9A%E4%BD%8D%E8%BF%87%E7%A8%8B%E5%88%86%E6%9E%90-toc\" style=\"margin-left:80px\">5.5 \u94fe\u63a5\u7684\u91cd\u5b9a\u4f4d\u8fc7\u7a0b\u5206\u6790<\/p>\n<p id=\"5.5.1%20%E9%93%BE%E6%8E%A5%E7%9A%84%E8%BF%87%E7%A8%8B-toc\" style=\"margin-left:120px\">5.5.1 \u94fe\u63a5\u7684\u8fc7\u7a0b<\/p>\n<p id=\"5.5.2%20%E9%87%8D%E5%AE%9A%E4%BD%8D%E5%88%86%E6%9E%90-toc\" style=\"margin-left:120px\">5.5.2 \u91cd\u5b9a\u4f4d\u5206\u6790<\/p>\n<p id=\"5.6%20hello%E7%9A%84%E6%89%A7%E8%A1%8C%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:80px\">5.6 hello\u7684\u6267\u884c\u6d41\u7a0b<\/p>\n<p id=\"5.7%20Hello%E7%9A%84%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5%E5%88%86%E6%9E%90-toc\" style=\"margin-left:80px\">5.7 Hello\u7684\u52a8\u6001\u94fe\u63a5\u5206\u6790<\/p>\n<p id=\"5.8%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">5.8 \u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%AC%AC6%E7%AB%A0%20hello%E8%BF%9B%E7%A8%8B%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:40px\">\u7b2c6\u7ae0 hello\u8fdb\u7a0b\u7ba1\u7406<\/p>\n<p id=\"6.1%20%E8%BF%9B%E7%A8%8B%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">6.1 \u8fdb\u7a0b\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/p>\n<p id=\"6.2%20%E7%AE%80%E8%BF%B0%E5%A3%B3Shell-bash%E7%9A%84%E4%BD%9C%E7%94%A8%E4%B8%8E%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:80px\">6.2 \u7b80\u8ff0\u58f3Shell-bash\u7684\u4f5c\u7528\u4e0e\u5904\u7406\u6d41\u7a0b<\/p>\n<p id=\"6.3%20Hello%E7%9A%84fork%E8%BF%9B%E7%A8%8B%E5%88%9B%E5%BB%BA%E8%BF%87%E7%A8%8B-toc\" style=\"margin-left:80px\">6.3 Hello\u7684fork\u8fdb\u7a0b\u521b\u5efa\u8fc7\u7a0b<\/p>\n<p id=\"6.4%20Hello%E7%9A%84execve%E8%BF%87%E7%A8%8B-toc\" style=\"margin-left:80px\">6.4 Hello\u7684execve\u8fc7\u7a0b<\/p>\n<p id=\"6.5%20Hello%E7%9A%84%E8%BF%9B%E7%A8%8B%E6%89%A7%E8%A1%8C-toc\" style=\"margin-left:80px\">6.5 Hello\u7684\u8fdb\u7a0b\u6267\u884c<\/p>\n<p id=\"6.6%20hello%E7%9A%84%E5%BC%82%E5%B8%B8%E4%B8%8E%E4%BF%A1%E5%8F%B7%E5%A4%84%E7%90%86-toc\" style=\"margin-left:80px\">6.6 hello\u7684\u5f02\u5e38\u4e0e\u4fe1\u53f7\u5904\u7406<\/p>\n<p id=\"6.7%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">6.7 \u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%AC%AC7%E7%AB%A0%20hello%E7%9A%84%E5%AD%98%E5%82%A8%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:40px\">\u7b2c7\u7ae0 hello\u7684\u5b58\u50a8\u7ba1\u7406<\/p>\n<p id=\"7.1%20hello%E7%9A%84%E5%AD%98%E5%82%A8%E5%99%A8%E5%9C%B0%E5%9D%80%E7%A9%BA%E9%97%B4-toc\" style=\"margin-left:80px\">7.1 hello\u7684\u5b58\u50a8\u5668\u5730\u5740\u7a7a\u95f4<\/p>\n<p id=\"7.2%20Intel%E9%80%BB%E8%BE%91%E5%9C%B0%E5%9D%80%E5%88%B0%E7%BA%BF%E6%80%A7%E5%9C%B0%E5%9D%80%E7%9A%84%E5%8F%98%E6%8D%A2-%E6%AE%B5%E5%BC%8F%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:80px\">7.2 Intel\u903b\u8f91\u5730\u5740\u5230\u7ebf\u6027\u5730\u5740\u7684\u53d8\u6362-\u6bb5\u5f0f\u7ba1\u7406<\/p>\n<p id=\"7.3%20Hello%E7%9A%84%E7%BA%BF%E6%80%A7%E5%9C%B0%E5%9D%80%E5%88%B0%E7%89%A9%E7%90%86%E5%9C%B0%E5%9D%80%E7%9A%84%E5%8F%98%E6%8D%A2-%E9%A1%B5%E5%BC%8F%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:80px\">7.3 Hello\u7684\u7ebf\u6027\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u53d8\u6362-\u9875\u5f0f\u7ba1\u7406<\/p>\n<p id=\"7.4%20TLB%E4%B8%8E%E5%9B%9B%E7%BA%A7%E9%A1%B5%E8%A1%A8%E6%94%AF%E6%8C%81%E4%B8%8B%E7%9A%84VA%E5%88%B0PA%E7%9A%84%E5%8F%98%E6%8D%A2-toc\" style=\"margin-left:80px\">7.4 TLB\u4e0e\u56db\u7ea7\u9875\u8868\u652f\u6301\u4e0b\u7684VA\u5230PA\u7684\u53d8\u6362<\/p>\n<p id=\"7.5%20%E4%B8%89%E7%BA%A7Cache%E6%94%AF%E6%8C%81%E4%B8%8B%E7%9A%84%E7%89%A9%E7%90%86%E5%86%85%E5%AD%98%E8%AE%BF%E9%97%AE-toc\" style=\"margin-left:80px\">7.5 \u4e09\u7ea7Cache\u652f\u6301\u4e0b\u7684\u7269\u7406\u5185\u5b58\u8bbf\u95ee<\/p>\n<p id=\"7.6%20hello%E8%BF%9B%E7%A8%8Bfork%E6%97%B6%E7%9A%84%E5%86%85%E5%AD%98%E6%98%A0%E5%B0%84-toc\" style=\"margin-left:80px\">7.6 hello\u8fdb\u7a0bfork\u65f6\u7684\u5185\u5b58\u6620\u5c04<\/p>\n<p id=\"7.7%20hello%E8%BF%9B%E7%A8%8Bexecve%E6%97%B6%E7%9A%84%E5%86%85%E5%AD%98%E6%98%A0%E5%B0%84-toc\" style=\"margin-left:80px\">7.7 hello\u8fdb\u7a0bexecve\u65f6\u7684\u5185\u5b58\u6620\u5c04<\/p>\n<p id=\"7.8%20%E7%BC%BA%E9%A1%B5%E6%95%85%E9%9A%9C%E4%B8%8E%E7%BC%BA%E9%A1%B5%E4%B8%AD%E6%96%AD%E5%A4%84%E7%90%86-toc\" style=\"margin-left:80px\">7.8 \u7f3a\u9875\u6545\u969c\u4e0e\u7f3a\u9875\u4e2d\u65ad\u5904\u7406<\/p>\n<p id=\"7.10%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93-toc\" style=\"margin-left:80px\">7.9\u00a0\u672c\u7ae0\u5c0f\u7ed3<\/p>\n<p id=\"%E7%BB%93%E8%AE%BA-toc\" style=\"margin-left:40px\">\u7ed3\u8bba<\/p>\n<p id=\"%E9%99%84%E4%BB%B6-toc\" style=\"margin-left:40px\">\u9644\u4ef6<\/p>\n<p id=\"%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE-toc\" style=\"margin-left:40px\">\u53c2\u8003\u6587\u732e<\/p>\n<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC1%E7%AB%A0%20%E6%A6%82%E8%BF%B0\" style=\"text-align:center\">\u7b2c1\u7ae0 \u6982\u8ff0<\/h3>\n<h4 id=\"1.1%20Hello%E7%AE%80%E4%BB%8B\">1.1 Hello\u7b80\u4ecb<\/h4>\n<ul>\n<li style=\"text-align:justify\">P2P&#xff1a;Program to Progress. Hello\u7531\u4e00\u4e2aC\u8bed\u8a00\u6e90\u7a0b\u5e8f&#xff08;Program&#xff09;&#xff0c;\u7ecf\u8fc7\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5&#xff0c;\u6700\u540e\u5728shell\u4e2d\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;shell\u4f1a\u7ed9hello\u5206\u914d\u8fdb\u7a0b\u7a7a\u95f4&#xff0c;\u8fd9\u4e2a\u65f6\u5019Hello\u4fbf\u6210\u4e3a\u4e86\u4e00\u4e2a\u8fdb\u7a0b&#xff08;Progress&#xff09;\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u5c31\u662fHello P2P\u7684\u6545\u4e8b\u3002<\/li>\n<li style=\"text-align:justify\">020&#xff1a;From Zero-0 to Zero-0. \u6307\u7684\u662f&#xff0c;\u5728\u7a0b\u5e8f\u6267\u884c\u4e4b\u524d&#xff0c;\u5185\u5b58\u7a7a\u95f4\u6ca1\u6709\u52a0\u8f7dHello\u8fdb\u7a0b&#xff0c;\u8fd9\u662fZero-0&#xff1b;\u5728Hello\u8fdb\u7a0b\u6267\u884c\u8fc7\u540e&#xff0c;\u5185\u6838\u4e5f\u4f1a\u5220\u9664<span style=\"background-color:#ffffff\">hello\u6587\u4ef6<\/span>\u76f8\u5173\u7684\u6240\u6709\u6570\u636e\u7ed3\u6784&#xff0c;\u7236\u8fdb\u7a0b\u56de\u6536\u5b50\u8fdb\u7a0b&#xff0c;\u53c8\u56de\u5230\u4e86Zero-0.<\/li>\n<\/ul>\n<h4 id=\"1.2%20%E7%8E%AF%E5%A2%83%E4%B8%8E%E5%B7%A5%E5%85%B7\">1.2 \u73af\u5883\u4e0e\u5de5\u5177<\/h4>\n<li style=\"text-align:justify\">\u786c\u4ef6\u73af\u5883&#xff1a;<\/li>\n<ul>\n<li style=\"text-align:justify\">\u5904\u7406\u5668&#xff1a;13th Gen Intel(R) Core(TM)\u00a0i9-13900HX \u00a0\u00a0\u00a02.2GHz<\/li>\n<li style=\"text-align:justify\">\u673a\u5e26RAM&#xff1a;32GB<\/li>\n<li style=\"text-align:justify\">Ubuntu\u914d\u7f6e\u5904\u7406\u5668\u5185\u6838&#xff1a;4*2 &#061; 8\u6838<\/li>\n<li style=\"text-align:justify\">Ubuntu\u5206\u914dRAM&#xff1a;8GB<\/li>\n<li style=\"text-align:justify\">Dell\u670d\u52a1\u5668\u786c\u4ef6\u73af\u5883<\/li>\n<\/ul>\n<li style=\"text-align:justify\">\u8f6f\u4ef6\u73af\u5883&#xff1a;<\/li>\n<ul>\n<li style=\"text-align:justify\">VMWare &#8211; Ubuntu 20.04\u865a\u62df\u673a<\/li>\n<li style=\"text-align:justify\">x86-64\u67b6\u6784\u64cd\u4f5c\u7cfb\u7edf&#xff08;Linux&#043;Windows 11&#xff09;<\/li>\n<li style=\"text-align:justify\">\u5f00\u53d1\u8c03\u8bd5\u5de5\u5177&#xff1a;vim 8.1.1847&#xff1b;GNU objdump 2.34&#xff1b;gcc 9.4.0&#xff1b;GNU gdb 9.2&#xff1b;edb 1.1.0&#xff1b;GNU readelf 2.34.&#xff08;\u7248\u672c\u4ee5Ubuntu\u865a\u62df\u673a\u5b89\u88c5\u5217\u51fa&#xff09;<\/li>\n<\/ul>\n<h4 id=\"1.3%20%E4%B8%AD%E9%97%B4%E7%BB%93%E6%9E%9C\">1.3 \u4e2d\u95f4\u7ed3\u679c<\/h4>\n<ul>\n<li style=\"text-align:justify\">hello.i&#xff1a;\u9884\u5904\u7406\u5f97\u5230\u7684\u6587\u672c\u6587\u4ef6<\/li>\n<li style=\"text-align:justify\">hello.s&#xff1a;\u7f16\u8bd1\u5f97\u5230\u7684\u6c47\u7f16\u8bed\u8a00\u6587\u4ef6<\/li>\n<li style=\"text-align:justify\">hello.o&#xff1a;\u6c47\u7f16\u5f97\u5230\u7684\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6<\/li>\n<li style=\"text-align:justify\">hello&#xff1a;\u94fe\u63a5\u5f97\u5230\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6<\/li>\n<li style=\"text-align:justify\">hello.elf&#xff1a;hello.o\u7684elf\u683c\u5f0f\u6587\u4ef6<\/li>\n<li style=\"text-align:justify\">hello.asm&#xff1a;\u5bf9hello.o\u53cd\u6c47\u7f16\u5f97\u5230\u7684\u53cd\u6c47\u7f16\u6587\u4ef6<\/li>\n<li style=\"text-align:justify\">hello1.asm&#xff1a;\u5bf9hello\u53cd\u6c47\u7f16\u5f97\u5230\u7684\u53cd\u6c47\u7f16\u6587\u4ef6<\/li>\n<\/ul>\n<h4 id=\"1.4%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">1.4 \u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u4ecb\u7ecd\u4e86Hello\u7684P2P\u548c020\u7684\u7ecf\u5386&#xff0c;\u5217\u4e3e\u4e86\u5b8c\u6210\u6b64\u7bc7\u62a5\u544a\u4f7f\u7528\u7684\u8f6f\u786c\u4ef6\u73af\u5883\u4ee5\u53ca\u751f\u6210\u7684\u4e2d\u95f4\u7ed3\u679c\u6587\u4ef6&#xff0c;\u7b80\u8981\u4ecb\u7ecd\u4e86\u6587\u4ef6\u7684\u6765\u6e90\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC2%E7%AB%A0%20%E9%A2%84%E5%A4%84%E7%90%86\" style=\"text-align:center\">\u7b2c2\u7ae0 \u9884\u5904\u7406<\/h3>\n<h4 id=\"2.1%20%E9%A2%84%E5%A4%84%E7%90%86%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8\">2.1 \u9884\u5904\u7406\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h4>\n<ul>\n<li style=\"text-align:justify\">\u9884\u5904\u7406\u7684\u6982\u5ff5&#xff1a;\u4f7f\u7528\u201c\u6e90.c\u201d\u6587\u4ef6\u751f\u6210\u201c\u6e90.i\u201d\u6587\u4ef6&#xff08;\u9884\u5904\u7406\u6587\u4ef6&#xff09;\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u662f\u7f16\u8bd1\u5668\u5904\u7406\u6e90\u7a0b\u5e8f\u7684\u7b2c\u4e00\u4e2a\u9636\u6bb5\u3002\u8fd9\u4e2a\u9636\u6bb5\u4e2d&#xff0c;\u7f16\u8bd1\u5668\u4f1a\u5c06\u201c\u6e90.c\u201d\u6587\u4ef6\u4e2d\u6d89\u53ca\u5230\u7684\u5b8f\u3001\u5934\u6587\u4ef6\u7b49\u8bed\u53e5\u4e00\u4e00\u5904\u7406&#xff0c;\u6bd4\u5982&#xff0c;\u6211\u4eec\u719f\u77e5\u7684\u7a0b\u5e8f\u4e2d\u5934\u6587\u4ef6(#include&lt;&#8230;&gt;)\u8bed\u53e5&#xff0c;\u5b8f\u66ff\u6362(#define &#8230;)\u8bed\u53e5&#xff0c;\u4ee5\u53ca\u4e00\u4e9b\u6761\u4ef6\u7f16\u8bd1\u8bed\u53e5(\u5982#ifdef\u3001#if\u3001#endif\u7b49)&#xff0c;\u90fd\u4f1a\u5728\u9884\u5904\u7406\u9636\u6bb5\u8fdb\u884c\u5c55\u5f00\u6216\u66ff\u6362\u3002\u6700\u540e&#xff0c;\u8fd9\u4e2a\u9636\u6bb5\u7f16\u8bd1\u5668\u4e5f\u4f1a\u53bb\u9664\u4ee3\u7801\u4e2d\u6240\u6709\u6ce8\u91ca\u7684\u90e8\u5206&#xff0c;\u5e76\u4e14\u4f1a\u751f\u6210\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u3002<\/li>\n<li style=\"text-align:justify\">\u9884\u5904\u7406\u7684\u4f5c\u7528&#xff1a;\u9884\u5904\u7406\u5bf9\u4e8e\u7a0b\u5e8f\u7684\u7f16\u8bd1\u3001\u6267\u884c\u5177\u6709\u5f88\u5f3a\u7684\u610f\u4e49\u3002#include\u7684\u5934\u6587\u4ef6\u5185\u5bb9\u76f4\u63a5\u63d2\u5165\u3001#define\u7684\u5b8f\u66ff\u6362\u5df2\u88ab\u76f4\u63a5\u5b9a\u4e49\u4e3a\u5b9e\u9645\u503c\u3001\u6ce8\u91ca\u7684\u5168\u90e8\u6e05\u9664&#xff0c;\u8fd9\u4e9b\u64cd\u4f5c\u53ef\u4ee5\u83b7\u5f97\u4e00\u4e2a\u5341\u5206\u5e72\u51c0\u3001\u5341\u5206\u5b8c\u6574\u7684\u4ee3\u7801\u6587\u4ef6\u4f9b\u7f16\u8bd1\u5668\u7ee7\u7eed\u5904\u7406\u3002\u8fd9\u6837\u4f1a\u5927\u5927\u51cf\u8f7b\u7f16\u8bd1\u73af\u8282\u7f16\u8bd1\u5668\u7684\u5904\u7406\u8d1f\u62c5\u3002<\/li>\n<\/ul>\n<h4 id=\"2.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E9%A2%84%E5%A4%84%E7%90%86%E7%9A%84%E5%91%BD%E4%BB%A4\">2.2 \u5728Ubuntu\u4e0b\u9884\u5904\u7406\u7684\u547d\u4ee4<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u751f\u6210\u9884\u5904\u7406\u540e\u6587\u4ef6\u7684\u547d\u4ee4\u4e3a&#xff1a;gcc -E hello.c -o hello.i&#xff08;\u4ee5hello.c &#8211; hello.i\u4e3a\u4f8b&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd07be4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 1 \u00a0\u9884\u5904\u7406\u64cd\u4f5c<\/p>\n<h4 id=\"2.3%20Hello%E7%9A%84%E9%A2%84%E5%A4%84%E7%90%86%E7%BB%93%E6%9E%9C%E8%A7%A3%E6%9E%90\">2.3 Hello\u7684\u9884\u5904\u7406\u7ed3\u679c\u89e3\u6790<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">hello.c\u6587\u4ef6\u4e2d\u4f7f\u7528\u4e86\u4e09\u4e2a\u5934\u6587\u4ef6&#xff0c;\u5206\u522b\u4e3a&lt;stdio.h&gt;\u3001&lt;unistd.h&gt;\u3001&lt;stdlib.h&gt;&#xff0c;\u4f7f\u7528Linux\u7684\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00hello.i\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u770b\u5230\u5934\u6587\u4ef6\u88ab\u5c55\u5f00\u7684\u5185\u5bb9&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd3444a.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd52ac0.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd6db9b.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd91fd4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 2 \u00a0\u9884\u5904\u7406\u6587\u4ef6\u5206\u6790<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Linux\u7cfb\u7edf\u5934\u6587\u4ef6\u5c55\u5f00\u8fc7\u7a0b\u4e2d&#xff0c;\u9884\u5904\u7406\u5668\u4f1a\u6839\u636e\u5934\u6587\u4ef6\u7684\u540d\u79f0\u5728&#xff08;\u9ed8\u8ba4\u7684\u6807\u51c6&#xff09;\u8def\u5f84&#034;\/usr\/include&#034;\u6216&#034;\/usr\/local\/include&#034;\u4e0b\u641c\u7d22&#xff1b;\u800c\u7528\u6237\u5934\u6587\u4ef6\u5c55\u5f00\u8fc7\u7a0b\u4e2d&#xff0c;\u9884\u5904\u7406\u5668\u5219\u4f1a\u4f18\u5148\u641c\u7d22\u6e90\u6587\u4ef6\u6240\u5728\u76ee\u5f55&#xff0c;\u4ee5\u83b7\u5f97\u76f8\u5e94\u7684\u5934\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u968f\u540e&#xff0c;\u9884\u5904\u7406\u5668\u4f1a\u5c06\u7528\u6237\u5934\u6587\u4ef6\u7684\u5185\u5bb9\u63d2\u5165\u5230hello.c\u4e2d\u7684\u5bf9\u5e94\u4f4d\u7f6e&#xff1b;\u7cfb\u7edf\u5934\u6587\u4ef6\u4f1a\u88ab\u9012\u5f52\u5c55\u5f00\u63d2\u5165\u5230\u6587\u4ef6\u4e2d&#xff0c;\u5e76\u4e14\u5728\u5c55\u5f00\u7684\u8fc7\u7a0b\u4e2d\u9884\u5904\u7406\u5668\u8fd8\u4f1a\u6dfb\u52a0# &lt;\u884c\u53f7&gt; &lt;\u6587\u4ef6\u540d&gt; &lt;\u6807\u5fd7&gt;\u8fd9\u6837\u7684\u6807\u8bb0&#xff08;\u5982\u56fe\u6240\u89c1&#xff09;\u3002\u6700\u540e&#xff0c;\u9884\u5904\u7406\u5668\u4f1a\u5220\u9664\u6240\u6709\u7684\u6ce8\u91ca\u5185\u5bb9&#xff0c;\u5c06\u4ee3\u7801\u90e8\u5206\u5b8c\u6574\u5730\u653e\u5165\u4e0e\u5904\u7406\u6587\u4ef6\u4e2d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6709\u5fc5\u8981\u6307\u51fa\u7684\u662f&#xff0c;\u9884\u5904\u7406\u7684\u8fc7\u7a0b\u4e0d\u4f1a\u8fdb\u884c\u4efb\u4f55\u7684\u8ba1\u7b97\u6216\u53d8\u6362&#xff0c;\u53ea\u4f1a\u8fdb\u884c\u7b80\u5355\u7684\u590d\u5236\u548c\u66ff\u6362\u3002<\/p>\n<h4 id=\"2.4%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">2.4 \u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u5bf9Linux\u73af\u5883\u4e0bhello.c\u7684\u9884\u5904\u7406\u64cd\u4f5c\u8fdb\u884c\u4e86\u8be6\u7ec6\u7684\u5206\u6790&#xff0c;\u63d0\u5230\u4e86\u83b7\u5f97\u9884\u5904\u7406\u6587\u4ef6\u7684\u547d\u4ee4&#xff0c;\u540c\u65f6\u9488\u5bf9\u9884\u5904\u7406\u6587\u4ef6\u627e\u5230\u4e86\u4e09\u4e2a\u5934\u6587\u4ef6\u5c55\u5f00\u7684\u8d77\u59cb\u4f4d\u7f6e&#xff0c;\u5bf9\u6bd4\u4e86\u4e3b\u7a0b\u5e8f\u90e8\u5206\u7684\u53d8\u5316&#xff08;\u6ca1\u6709\u53d8\u5316&#xff09;\u3002\u901a\u8fc7\u5206\u6790&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5f97\u51fa\u9884\u5904\u7406\u9636\u6bb5&#xff0c;\u9884\u5904\u7406\u5668\u4f1a\u5bf9C\u7a0b\u5e8f\u6587\u4ef6\u8fdb\u884c\u4e00\u4e9b\u57fa\u672c\u7684\u6587\u672c\u590d\u5236\u548c\u66ff\u6362&#xff0c;\u6bd4\u5982\u5c06\u5934\u6587\u4ef6\u7684\u5185\u5bb9\u590d\u5236\u5230\u6587\u672c\u4e2d&#xff0c;\u5c06\u5b8f\u66ff\u6362\u7684\u5185\u5bb9\u66ff\u6362\u4e3a\u5b9e\u9645\u503c\u7b49\u3002\u6700\u540e\u4f1a\u5f97\u5230\u4e00\u4e2ahello.i\u6587\u672c\u6587\u4ef6\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC3%E7%AB%A0%20%E7%BC%96%E8%AF%91\" style=\"text-align:center\">\u7b2c3\u7ae0 \u7f16\u8bd1<\/h3>\n<h4 id=\"3.1%20%E7%BC%96%E8%AF%91%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8\">3.1 \u7f16\u8bd1\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h4>\n<ul>\n<li style=\"text-align:justify\">\u7f16\u8bd1\u7684\u6982\u5ff5&#xff1a;\u4f7f\u7528\u201c\u6e90.i\u201d\u6587\u4ef6\u751f\u6210\u201c\u6e90.s\u201d\u6587\u4ef6&#xff08;\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f&#xff09;\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u662f\u4ee3\u7801\u7ffb\u8bd1\u8fc7\u7a0b\u7684\u6838\u5fc3\u9636\u6bb5&#xff0c;\u4f1a\u5c06\u9884\u5904\u7406\u540e\u7684\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f&#xff0c;\u7531\u7f16\u8bd1\u5668&#xff08;\u5982GCC\u7684cc1\u7ec4\u4ef6&#xff09;\u6765\u5b8c\u6210\u3002\u8be5\u9636\u6bb5\u7684\u4e3b\u8981\u5de5\u4f5c\u6709&#xff1a;\u8bcd\u6cd5\u5206\u6790\u4e0e\u8bed\u6cd5\u5206\u6790\u3001\u8bed\u4e49\u5206\u6790\u3001\u4e2d\u95f4\u4ee3\u7801\u751f\u6210\u4e0e\u4f18\u5316\u3001\u6c47\u7f16\u7a0b\u5e8f\u751f\u6210\u3002\u6700\u540e\u4f1a\u751f\u6210\u4e00\u4e2a\u7531\u673a\u5668\u6307\u4ee4\u7ec4\u6210\u7684\u4e0e\u6e90\u7a0b\u5e8f\u7b49\u4ef7\u7684\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f\u3002<\/li>\n<li style=\"text-align:justify\">\u7f16\u8bd1\u7684\u4f5c\u7528&#xff1a;\u7f16\u8bd1\u662f\u9ad8\u7ea7\u8bed\u8a00\u4e0e\u673a\u5668\u8bed\u8a00\u7684\u6865\u6881\u3002\u5c06\u673a\u5668\u4e0d\u80fd\u76f4\u63a5\u201c\u8bfb\u61c2\u201d\u7684\u9ad8\u7ea7\u8bed\u8a00\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u7b26\u5408\u673a\u5668\u8fd0\u884c\u903b\u8f91\u7684\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f\u3002\u53e6\u5916&#xff0c;\u901a\u8fc7\u8fdb\u884c-O1\u3001-O2\u3001-Og\u7b49\u4f18\u5316&#xff0c;\u7f16\u8bd1\u5668\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5220\u9664\u5197\u4f59\u4ee3\u7801\u3001\u8c03\u6574\u6267\u884c\u987a\u5e8f\u7b49\u65b9\u5f0f\u63d0\u5347\u7a0b\u5e8f\u6548\u7387\u3002<\/li>\n<\/ul>\n<h4 id=\"3.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E7%BC%96%E8%AF%91%E7%9A%84%E5%91%BD%E4%BB%A4\">3.2 \u5728Ubuntu\u4e0b\u7f16\u8bd1\u7684\u547d\u4ee4<\/h4>\n<p style=\"margin-left:0.0000pt;text-align:justify\">Linux\u73af\u5883\u4e0b\u751f\u6210\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f\u7684\u547d\u4ee4\u4e3a&#xff1a;gcc -S hello.i -o hello.s<\/p>\n<p style=\"margin-left:0pt;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be0411a.png\" \/><\/p>\n<p style=\"margin-left:0.0000pt;text-align:center\">\u56fe 3 \u00a0\u7f16\u8bd1\u64cd\u4f5c<\/p>\n<h4 id=\"3.3%20Hello%E7%9A%84%E7%BC%96%E8%AF%91%E7%BB%93%E6%9E%9C%E8%A7%A3%E6%9E%90\">3.3 Hello\u7684\u7f16\u8bd1\u7ed3\u679c\u89e3\u6790<\/h4>\n<h5 id=\"3.3.1%20%E6%95%B0%E6%8D%AE\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.1 \u6570\u636e<\/h5>\n<ul>\n<li style=\"text-align:justify\">\u5e38\u91cf&#xff1a;\u4ecehello.s\u6587\u4ef6\u4e2d\u53ef\u77e5&#xff0c;\u7a0b\u5e8f\u6709\u4e24\u4e2a\u5b57\u7b26\u4e32\u5e38\u91cf&#xff0c;\u5206\u522b\u4e3a&#034;\u7528\u6cd5: Hello \u5b66\u53f7 \u59d3\u540d \u624b\u673a\u53f7 \u79d2\u6570&#xff01;\\\\n&#034;\u548c&#034;Hello %s %s %s\\\\n&#034;\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be20b80.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 4 \u00a0\u5b57\u7b26\u4e32\u5e38\u91cf\u7684\u5b58\u50a8\u5f62\u5f0f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fd9\u4e24\u4e2a\u5b57\u7b26\u4e32\u5e38\u91cf\u4f1a\u5b58\u653e\u5728.rodata\u53ea\u8bfb\u6570\u636e\u6bb5\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be43b1f.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 5 \u00a0\u5b57\u7b26\u4e32\u5e38\u91cf\u7684\u5b58\u50a8\u4f4d\u7f6e<\/p>\n<ul>\n<li style=\"text-align:justify\">\u5c40\u90e8\u53d8\u91cf&#xff1a;\u7a0b\u5e8f\u4e2d\u53ea\u6709\u4e00\u4e2a\u5c40\u90e8\u53d8\u91cfi&#xff0c;\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5b58\u653e\u5728\u6808\u5185&#xff0c;<\/li>\n<\/ul>\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be6b3fe.png\" \/><\/p>\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be7567c.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 6 \u00a0\u5c40\u90e8\u53d8\u91cf\u7684\u8d4b\u503c\u548c\u5b58\u50a8\u4f4d\u7f6e<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7531hello.s\u53ef\u77e5&#xff0c;\u8be5\u5c40\u90e8\u53d8\u91cf\u5b58\u653e\u5728\u6808\u4e0a-4(%rbp)\u7684\u4f4d\u7f6e\u3002<\/p>\n<ul>\n<li style=\"text-align:justify\">\u8868\u8fbe\u5f0f&#xff1a;\u7a0b\u5e8f\u4e2d\u5728if\u5224\u65ad\u5904\u548cfor\u5faa\u73af\u5904\u5171\u6709\u4e24\u4e2a\u903b\u8f91\u8868\u8fbe\u5f0f&#xff0c;\u5206\u522b\u4e3a&#034;argc !&#061; 5&#034;\u548c&#034;i &lt; 10&#034;&#xff0c;\u6267\u884c\u7684\u4f4d\u7f6e\u5206\u522b\u4e3a&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be7f430.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be89f41.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 7 \u00a0\u903b\u8f91\u8868\u8fbe\u5f0f\u7684\u5b9e\u73b0<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7c7b\u578b&#xff1a;\u7a0b\u5e8f\u4e2d\u5171\u6d89\u53ca\u4e86int\u3001string\u4e24\u4e2a\u53d8\u91cf\u7c7b\u578b&#xff0c;\u5bf9\u4e8eint\u7c7b\u578b\u7684\u5c40\u90e8\u53d8\u91cf&#xff0c;\u7f16\u8bd1\u5668\u4f1a\u5206\u914d4\u4e2a\u5b57\u8282\u7684\u6808\u7a7a\u95f4\u5e76\u5c06\u5176\u538b\u5165\u6808\u4e2d&#xff1b;\u800c\u5bf9\u4e8e\u5b57\u7b26\u4e32\u5e38\u91cf\u7c7b\u578b\u7684\u6570\u636e&#xff0c;\u7f16\u8bd1\u5668\u5728\u7a0b\u5e8f\u7684\u53ea\u8bfb\u6570\u636e\u6bb5\u7ed9\u5b57\u7b26\u4e32\u5e38\u91cf\u5206\u914d\u8fde\u7eed\u7684\u4e00\u5757\u7a7a\u95f4\u5b58\u50a8\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be93371.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 8 \u00a0\u5c40\u90e8\u53d8\u91cfi\u7684\u5b58\u50a8\u65b9\u5f0f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u5e0c\u671b\u8bfb\u53d6\u5c40\u90e8\u53d8\u91cf\u65f6&#xff0c;\u76f4\u63a5\u8bbf\u95ee\u6808\u6307\u9488\u504f\u79fb\u6240\u5728\u7684\u5730\u5740&#xff1b;\u5f53\u8bbf\u95eestring\u5e38 \u91cf\u65f6&#xff0c;\u5219\u901a\u8fc7\u4f7f\u7528RIP\u76f8\u5bf9\u5bfb\u5740\u8bfb\u53d6\u5b57\u7b26\u4e32\u5e38\u91cf\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782be9d119.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782bea642e.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 9 \u00a0RIP\u76f8\u5bf9\u5bfb\u5740<\/p>\n<h5 id=\"3.3.2%20%E8%B5%8B%E5%80%BC\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.2 \u8d4b\u503c<\/h5>\n<ul>\n<li style=\"text-align:justify\">\u53d8\u91cf\u2018i\u2019&#xff1a;\u7f16\u8bd1\u5668\u5c06\u5c40\u90e8\u53d8\u91cf\u5b58\u50a8\u5728\u6808\u4e2d&#xff0c;\u6839\u636e\u6211\u4eec\u7684\u6e90\u7a0b\u5e8f&#xff0c;\u5b9a\u4e49i\u65f6\u5e76\u672a\u8fdb\u884c\u8d4b\u521d\u503c&#xff0c;\u9996\u6b21\u5bf9i\u8d4b\u503c\u662f\u5728for\u5faa\u73af\u65f6&#xff1b;\u518d\u4ecehello.s\u6587\u4ef6\u4e2d\u53ef\u5f97&#xff0c;\u673a\u5668\u53ea\u5bf9i\u8fdb\u884c\u4e86\u4e00\u6b21\u8d4b\u503c\u5982\u56fe6\u6240\u793a\u3002\u6240\u4ee5\u53ef\u4ee5\u53d1\u73b0&#xff0c;\u5c40\u90e8\u53d8\u91cf\u7684\u5b9a\u4e49\u5e76\u4e0d\u4f1a\u5355\u72ec\u5206\u914d\u673a\u5668\u6307\u4ee4\u6267\u884c&#xff0c;\u53ea\u6709\u5728\u8d4b\u503c\u65f6\u624d\u4f1a\u6267\u884c\u76f8\u5173\u673a\u5668\u6307\u4ee4\u3002<\/li>\n<\/ul>\n<h5 id=\"3.3.3%20%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.3 \u7c7b\u578b\u8f6c\u6362<\/h5>\n<ul>\n<li style=\"text-align:justify\">atoi()\u51fd\u6570&#xff1a;\u8be5\u51fd\u6570\u4f1a\u5c06\u4f20\u9012\u7ed9\u5b83\u7684\u5b57\u7b26\u4e32\u8f6c\u5316\u4e3a\u6574\u578b\u6570&#xff0c;\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9sleep()\u51fd\u6570\u3002<\/li>\n<\/ul>\n<h5 id=\"3.3.4%20%E7%AE%97%E6%9C%AF%E6%93%8D%E4%BD%9C\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.4 \u7b97\u672f\u64cd\u4f5c<\/h5>\n<ul>\n<li style=\"text-align:justify\">\u5faa\u73af\u7d2f\u52a0&#xff1a;\u5728\u6bcf\u6b21\u5faa\u73af\u7ed3\u675f\u540e&#xff0c;\u7a0b\u5e8f\u4f1a\u6267\u884ci&#043;&#043;\u7684\u7b97\u672f\u64cd\u4f5c&#xff0c;\u6bcf\u6b21\u5bf9-4(%rbp)\u52a0\u4e00\u8fd0\u7b97\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782beafa73.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 10 \u00a0\u64cd\u4f5ci&#043;&#043;<\/p>\n<h5 id=\"3.3.5%20%E5%85%B3%E7%B3%BB%E6%93%8D%E4%BD%9C\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.5 \u5173\u7cfb\u64cd\u4f5c<\/h5>\n<ul>\n<li style=\"text-align:justify\">\u6761\u4ef6\u5224\u65ad&#xff1a;\u5982\u56fe9&#xff0c;\u7a0b\u5e8f\u4e2d\u5171\u6709\u4e24\u4e2a\u5173\u7cfb\u64cd\u4f5c&#xff0c;\u5206\u522b\u4e3a&#034;argc !&#061; 5&#034;\u548c&#034;i &lt; 10&#034;\u3002<\/li>\n<\/ul>\n<h5 id=\"3.3.6%20%E6%8C%87%E9%92%88%E6%93%8D%E4%BD%9C\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.6 \u6307\u9488\u64cd\u4f5c<\/h5>\n<ul>\n<li style=\"text-align:justify\">main\u51fd\u6570\u53c2\u6570*argv[]\u7684\u4f20\u9012&#xff1a;\u6307\u9488\u572864\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u4ee58\u5b57\u8282\u5f62\u5f0f\u5b58\u50a8&#xff0c;\u5e76\u4e14\u901a\u8fc7\u5176\u5b58\u50a8\u7684\u5730\u5740\u8bbf\u95ee\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u3002\u4ecehello.s\u4e2d\u5f97\u5230&#xff0c;*argv[]\u7684\u5b58\u50a8\u4f4d\u7f6e\u5982\u4e0b\u56fe&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782beb9b75.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782bed4599.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 11 \u00a0argv[]\u5728\u6808\u4e2d\u7684\u5b58\u50a8<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782bee2d52.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005630-684782bef1919.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 12 \u00a0argv[1~4]\u7684\u5185\u5bb9\u8bfb\u53d6<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<h5 id=\"3.3.7%20%E6%8E%A7%E5%88%B6%E8%BD%AC%E7%A7%BB\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.7 \u63a7\u5236\u8f6c\u79fb<\/h5>\n<ul>\n<li style=\"text-align:justify\">\u6761\u4ef6\u5224\u65ad\u8bed\u53e5&#xff1a;\u7a0b\u5e8f\u7684\u4e24\u4e2a\u6761\u4ef6\u5224\u65ad\u8f6c\u79fb\u8bed\u53e5\u5206\u522b\u4e3a&#034;if (argc !&#061; 5)&#034;\u548c&#034;for (i &#061; 0; i\u00a0&lt; 10; i&#043;&#043;)&#034;&#xff0c;\u5b9e\u73b0\u65b9\u5f0f\u5982\u56fe7\u3002<\/li>\n<\/ul>\n<h5 id=\"3.3.8%20%E5%87%BD%E6%95%B0%E6%93%8D%E4%BD%9C\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">3.3.8 \u51fd\u6570\u64cd\u4f5c<\/h5>\n<ul>\n<li style=\"text-align:justify\">main&#xff08;\u53c2\u6570\u4f20\u9012&#xff09;&#xff1a;main\u51fd\u6570\u5171\u6709\u4e24\u4e2a\u53c2\u6570argc&#xff0c;argv[]&#xff0c;argc\u3001argv[]\u7684\u4f20\u9012\u5982\u4e0b<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10v3tqdefrdb1.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 13 \u00a0argc\u4e0eargv[]\u7684\u53c2\u6570\u4f20\u9012<\/p>\n<ul>\n<li style=\"text-align:justify\">printf&#xff08;\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u8c03\u7528&#xff09;&#xff1a;\u7a0b\u5e8f\u4e2d\u5171\u6709\u4e24\u4e2aprintf\u51fd\u6570&#xff0c;\u7b2c\u4e00\u4e2aprintf\u51fd\u6570\u53c2\u6570\u53ea\u6709\u4e00\u4e2a\u5b57\u7b26\u4e32\u5e38\u91cf&#xff0c;\u8be5\u51fd\u6570\u4ee5\u53ca\u7b2c\u4e8c\u4e2aprintf\u7b2c\u4e00\u4e2a\u53c2\u6570\u7684\u53c2\u6570\u4f20\u9012\u89c1\u56fe9&#xff1b;\u7b2c\u4e8c\u4e2aprintf\u51fd\u6570\u8fd8\u5305\u62ecargv[1]\u3001argv[2]\u3001argv[3]\u4e09\u4e2a\u53c2\u6570\u7684\u4f20\u9012&#xff0c;\u89c1\u56fe11\u3002printf\u5728\u8c03\u7528\u51fd\u6570\u65f6&#xff0c;\u4f1a\u8df3\u8f6c\u5230\u76f8\u5e94\u51fd\u6570\u5185\u5bb9\u7684\u5730\u5740&#xff0c;\u5177\u4f53\u5982\u4e0b&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10cely0etnuga.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10t1pid0fu22w.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 14 \u00a0printf\u51fd\u6570\u8c03\u7528<\/p>\n<ul>\n<li style=\"text-align:justify\">exit&#xff08;\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u8c03\u7528&#xff09;&#xff1a;exit\u51fd\u6570\u4f20\u9012\u4e86\u4e00\u4e2a\u53c2\u6570\u4e3a1&#xff0c;\u8868\u793a\u7acb\u5373\u7ec8\u6b62\u6574\u4e2a\u7a0b\u5e8f\u5e76\u8fd4\u56de\u201c\u5931\u8d25\u201d\u4fe1\u53f71\u3002\u53c2\u6570\u4f20\u9012\u548c\u51fd\u6570\u8c03\u7528\u90e8\u5206\u5982\u56fe&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10m3qoqb1o32i.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 15 \u00a0exit\u51fd\u6570\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u8c03\u7528<\/p>\n<ul>\n<li style=\"text-align:center\">sleep&#xff08;\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u8c03\u7528&#xff09;&#xff1a;sleep\u51fd\u6570\u7684\u53c2\u6570\u5373atoi\u51fd\u6570\u7684\u8fd4\u56de\u503c&#xff0c;\u7531\u4e8e\u51fd\u6570\u7684\u8fd4\u56de\u503c\u5b58\u5728\u5bc4\u5b58\u5668&#xff0c;\u5219\u4ecehello.s\u4e2d\u53ef\u627e\u5230&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10z42p5z1uqjr.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe16 \u00a0sleep\u51fd\u6570\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u8c03\u7528<\/p>\n<ul>\n<li style=\"text-align:justify\">atoi&#xff08;\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u8c03\u7528\u3001\u5c40\u90e8\u53d8\u91cf\u3001\u51fd\u6570\u8fd4\u56de&#xff09;&#xff1a;atoi\u51fd\u6570\u662f\u5c06\u5b57\u7b26\u4e32\u8f6c\u5316\u4e3a\u6574\u578b\u6570\u7684\u51fd\u6570&#xff0c;\u53c2\u6570\u4f20\u9012\u89c1\u56fe11&#xff1b;\u51fd\u6570\u8c03\u7528\u89c1\u56fe16&#xff1b;\u4f20\u5165\u7684\u53c2\u6570\u662fargv[4]&#xff0c;\u8fd9\u4e2a\u53c2\u6570\u5728\u51fd\u6570atoi\u4e2d\u5c5e\u4e8e\u5c40\u90e8\u53d8\u91cf&#xff0c;\u53ef\u4ee5\u4fee\u6539\u6307\u9488\u7684\u503c&#xff0c;\u4f46\u662f\u4e0d\u80fd\u4fee\u6539\u6307\u9488\u6307\u5411\u7684\u5b57\u7b26\u4e32\u7684\u5185\u5bb9&#xff1b;\u51fd\u6570\u8fd4\u56de\u89c1\u56fe16&#xff0c;\u8fd4\u56de\u503c\u4f5c\u4e3asleep\u51fd\u6570\u7684\u53c2\u6570\u3002<\/li>\n<li style=\"text-align:justify\">getchar&#xff08;\u51fd\u6570\u8c03\u7528&#xff09;&#xff1a;getchar\u6ca1\u6709\u53c2\u6570\u4f20\u5165&#xff0c;\u51fd\u6570\u8c03\u7528\u5982\u56fe&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10j203gnk1him.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u56fe 17 \u00a0getchar\u51fd\u6570\u8c03\u7528<\/p>\n<h4 id=\"3.4%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">3.4 \u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u4e2d&#xff0c;\u5bf9\u9884\u5904\u7406\u6587\u4ef6\u8fdb\u884c\u7f16\u8bd1&#xff0c;\u5f97\u5230\u4e86hello.s\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f&#xff0c;\u5e76\u4e14\u5bf9hello.s\u6587\u4ef6\u8fdb\u884c\u4e86\u8be6\u5c3d\u7684\u5206\u6790\u3002\u5206\u6790\u5305\u62ec\u4e86\u6570\u636e\u3001\u8d4b\u503c\u3001\u7c7b\u578b\u8f6c\u6362\u3001\u7b97\u672f\u64cd\u4f5c\u3001\u5173\u7cfb\u64cd\u4f5c\u3001\u6307\u9488\u64cd\u4f5c\u3001\u63a7\u5236\u8f6c\u79fb\u3001\u51fd\u6570\u64cd\u4f5c\u51e0\u5927\u65b9\u9762\u3002\u901a\u8fc7\u5bf9\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f\u7684\u5206\u6790&#xff0c;\u53ef\u4ee5\u66f4\u52a0\u6e05\u6670\u7684\u7406\u89e3\u673a\u5668\u6307\u4ee4\u6267\u884c\u7684\u903b\u8f91&#xff0c;\u611f\u53d7\u8ba1\u7b97\u673a\u7a0b\u5e8f\u7684\u6267\u884c\u65b9\u5f0f\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC4%E7%AB%A0%20%E6%B1%87%E7%BC%96\" style=\"text-align:center\">\u7b2c4\u7ae0 \u6c47\u7f16<\/h3>\n<h4 id=\"4.1%20%E6%B1%87%E7%BC%96%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8\">4.1 \u6c47\u7f16\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h4>\n<ul>\n<li style=\"text-align:justify\">\u6c47\u7f16\u7684\u6982\u5ff5&#xff1a;\u4f7f\u7528\u201c\u6e90.s\u201d\u6587\u4ef6\u751f\u6210\u201c\u6e90.o\u201d\u6587\u4ef6&#xff08;\u673a\u5668\u8bed\u8a00\u4e8c\u8fdb\u5236\u7a0b\u5e8f&#xff09;\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u7531\u6c47\u7f16\u5668\u5b8c\u6210&#xff0c;\u5c06\u4eba\u7c7b\u53ef\u8bfb\u7684\u6c47\u7f16\u6307\u4ee4\u9010\u6761\u7ffb\u8bd1\u4e3a\u5bf9\u5e94\u7684\u4e8c\u8fdb\u5236\u673a\u5668\u7801&#xff0c;\u4ee5\u4f9b\u8ba1\u7b97\u673a\u6267\u884c&#xff1b;\u540c\u65f6\u4f1a\u5904\u7406\u6807\u7b7e\u548c\u7b26\u53f7&#xff0c;\u5c06\u5176\u8f6c\u6362\u4e3a\u5185\u5b58\u5730\u5740\u6216\u504f\u79fb\u91cf\u3002\u6700\u540e\u4f1a\u751f\u6210\u4e00\u4e2a\u5305\u542b\u673a\u5668\u7801\u3001\u7b26\u53f7\u8868\u3001\u91cd\u5b9a\u4f4d\u4fe1\u606f\u7b49\u5185\u5bb9\u7684\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff0c;\u4f9b\u540e\u7eed\u94fe\u63a5\u5668\u4f7f\u7528\u3002<\/li>\n<li style=\"text-align:justify\">\u6c47\u7f16\u7684\u4f5c\u7528&#xff1a;\u586b\u8865\u9ad8\u7ea7\u8bed\u8a00\u4e0e\u673a\u5668\u8bed\u8a00\u7684\u9e3f\u6c9f&#xff0c;\u662f\u7f16\u8bd1\u6d41\u7a0b\u7684\u5173\u952e\u6b65\u9aa4\u3002\u5e76\u4e14\u6c47\u7f16\u8bed\u8a00\u53ef\u4ee5\u7cbe\u786e\u64cd\u4f5c\u5bc4\u5b58\u5668\u3001\u5185\u5b58\u7b49\u786c\u4ef6\u8d44\u6e90&#xff0c;\u9002\u7528\u4e8e\u5e95\u5c42\u5f00\u53d1&#xff1b;\u6700\u540e&#xff0c;\u901a\u8fc7\u624b\u5199\u6c47\u7f16\u4ee3\u7801\u6216\u5206\u6790\u7f16\u8bd1\u5668\u751f\u6210\u7684\u6c47\u7f16\u8f93\u51fa&#xff0c;\u53ef\u4f18\u5316\u5173\u952e\u4ee3\u7801\u6bb5\u7684\u6267\u884c\u6548\u7387\u3002<\/li>\n<\/ul>\n<h4 id=\"4.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E6%B1%87%E7%BC%96%E7%9A%84%E5%91%BD%E4%BB%A4\">4.2 \u5728Ubuntu\u4e0b\u6c47\u7f16\u7684\u547d\u4ee4<\/h4>\n<p style=\"margin-left:0.0000pt;text-align:justify\">Linux\u73af\u5883\u4e0b\u751f\u6210\u673a\u5668\u8bed\u8a00\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u7684\u547d\u4ee4\u4e3a&#xff1a;gcc -C\u00a0hello.s\u00a0-o hello.o<\/p>\n<p style=\"margin-left:0pt;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10p34e2bqng4t.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 18\u00a0\u00a0\u673a\u5668\u8bed\u8a00\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u7684\u751f\u6210<\/p>\n<h4 id=\"4.3%20%E5%8F%AF%E9%87%8D%E5%AE%9A%E4%BD%8D%E7%9B%AE%E6%A0%87elf%E6%A0%BC%E5%BC%8F\">4.3 \u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807elf\u683c\u5f0f<\/h4>\n<ul>\n<li style=\"text-align:justify\">ELF\u5934<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10yyg5vzajnmk.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 19 \u00a0ELF\u5934\u76f8\u5173\u4fe1\u606f<\/p>\n<ul>\n<li style=\"text-align:justify\">\u8282\u5934&#xff1a;\u4f7f\u7528readelf -S\u547d\u4ee4&#xff0c;\u83b7\u5f97\u5404\u4e2a\u8282\u7684\u57fa\u672c\u4fe1\u606f&#xff1a;\u5176\u4e2d.text\u3001.rodata\u3001.data\u3001.plt\u662f\u5173\u952e\u8282\u533a&#xff0c;.text\u548c.plt\u662f\u4ee3\u7801\u8282\u533a&#xff0c;.data\u548c.rodata\u662f\u6570\u636e\u8282\u533a&#xff0c;\u8fd9\u4e24\u4e2a\u8282\u533a\u662fELF\u6587\u4ef6\u7684\u6700\u6838\u5fc3\u90e8\u5206&#xff0c;\u5206\u522b\u5b58\u50a8\u53ef\u6267\u884c\u6307\u4ee4\u548c\u6570\u636e\u3002<\/li>\n<\/ul>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u00a0<img decoding=\"async\" alt=\"\" src=\"2025-06-10pzn5hvvu5ev.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-102fyrwzbjnf2.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 20 \u00a0hello.o\u7684elf\u683c\u5f0f\u8282\u5934\u57fa\u672c\u4fe1\u606f<\/p>\n<ul>\n<li style=\"text-align:justify\">\u91cd\u5b9a\u4f4d\u8282&#xff1a;\u4eceelf\u6587\u4ef6\u4e2d\u53ef\u4ee5\u770b\u51fa&#xff0c;\u5176\u5305\u542b\u4e86\u4e24\u4e2a\u91cd\u5b9a\u4f4d\u8282&#xff1a;.rela.dyn\u4ee5\u53ca.rela.plt\u3002.rela.dyn\u4e3a\u5904\u7406\u52a8\u6001\u94fe\u63a5\u65f6\u7684\u6570\u636e\u5f15\u7528&#xff0c;.rela.plt\u4e3a\u5904\u7406\u52a8\u6001\u94fe\u63a5\u65f6\u7684\u51fd\u6570\u8df3\u8f6c\u3002ELF\u91cd\u5b9a\u4f4d\u4fe1\u606f\u662f\u94fe\u63a5\u5668\u4fee\u6b63\u5916\u90e8\u7b26\u53f7\u5f15\u7528\u7684&#034;\u5730\u5740\u8865\u4e01&#034;\u3002\u7f16\u8bd1\u65f6&#xff0c;\u9047\u5230\u672a\u89e3\u6790\u7684\u51fd\u6570\u6216\u53d8\u91cf\u4f1a\u751f\u6210\u91cd\u5b9a\u4f4d\u8bb0\u5f55&#xff1b;\u94fe\u63a5\u65f6&#xff0c;\u8fd9\u4e9b\u8bb0\u5f55\u6307\u5bfc\u94fe\u63a5\u5668\u5c06\u7b26\u53f7\u5f15\u7528\u66ff\u6362\u4e3a\u771f\u5b9e\u5730\u5740[2]\u3002<\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#00b0f0\">\u91cd\u5b9a\u4f4d\u8282rela.dyn<\/span>\u4e2d&#xff0c;\u7c7b\u578bR_X86_64_RELATIVE\u7528\u4e8e\u4f4d\u7f6e\u65e0\u5173\u4ee3\u7801&#xff08;PIC&#xff09;&#xff0c; \u8ba1\u7b97\u65b9\u5f0f&#xff1a;\u57fa\u5730\u5740 &#043; \u52a0\u6570&#xff1b;R_X86_64_GLOB_DAT\u4f1a\u5728\u52a8\u6001\u94fe\u63a5\u65f6&#xff0c;\u5c06\u5168\u5c40 \u504f\u79fb\u8868&#xff08;GOT&#xff09;\u4e2d\u7684\u6761\u76ee\u7ed1\u5b9a\u5230\u7b26\u53f7\u7684\u5b9e\u9645\u5730\u5740\u3002\u5728<span style=\"color:#00b0f0\">\u91cd\u5b9a\u4f4d\u8282rela.plt<\/span>\u4e2d&#xff0c;R _X86_64_JUMP_SLO\u4f1a\u5728\u52a8\u6001\u94fe\u63a5\u65f6&#xff0c;\u4fee\u6b63PLT&#xff08;\u8fc7\u7a0b\u94fe\u63a5\u8868&#xff09;\u4e2d\u7684\u8df3\u8f6c\u5730 \u5740&#xff0c;\u540c\u65f6\u9996\u6b21\u8c03\u7528\u51fd\u6570\u65f6&#xff0c;\u901a\u8fc7\u5ef6\u8fdf\u7ed1\u5b9a\u89e3\u6790\u5b9e\u9645\u5730\u5740&#xff08;\u5982 printf&#064;GLIBC_2.2.5&#xff09;\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10yxatxmtghsy.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 21 \u00a0elf\u91cd\u5b9a\u4f4d\u9879\u76ee\u4fe1\u606f<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7b26\u53f7\u8868&#xff1a;\u8bb0\u5f55\u4e86\u6240\u6709\u51fd\u6570\u3001\u53d8\u91cf\u7b49\u7b26\u53f7\u7684\u5173\u952e\u4fe1\u606f&#xff0c;\u4e3b\u8981\u7528\u4e8e\u94fe\u63a5\u548c\u8c03\u8bd5\u3002\u94fe\u63a5\u65f6\u901a\u8fc7\u7b26\u53f7\u8868\u67e5\u627e\u672a\u5b9a\u4e49\u7684\u51fd\u6570\u540d\u548c\u53d8\u91cf\u540d&#xff0c;\u786e\u4fdd\u5b83\u4eec\u80fd\u6b63\u786e\u7ed1\u5b9a\u5230\u5e93\u6216\u5176\u5b83\u6a21\u5757\u4e2d\u7684\u5b9e\u73b0\u3002\u5c06\u7b26\u53f7\u540d\u4e0e\u5176\u5728\u5185\u5b58\u6216\u6587\u4ef6\u4e2d\u7684\u4f4d\u7f6e&#xff08;\u5982.text\u4e2d\u7684\u51fd\u6570\u5730\u5740\u3001.data\u4e2d\u7684\u53d8\u91cf\u5730\u5740&#xff09;\u5efa\u7acb\u6620\u5c04&#xff0c;\u4f9b\u94fe\u63a5\u5668\u4fee\u6b63\u5f15\u7528\u3002\u4fdd\u7559\u7b26\u53f7\u540d\u4e0e\u6e90\u7801\u7684\u5bf9\u5e94\u5173\u7cfb&#xff08;\u9700\u7f16\u8bd1\u65f6\u52a0-g&#xff09;&#xff0c;\u5d29\u6e83\u65f6\u80fd\u8f93\u51fa\u51fd\u6570\u540d\u800c\u975e\u88f8\u5730\u5740\u3002<\/li>\n<\/ul>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10wg4tqg1s1kb.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10zmp1mnkgq1k.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10zetey2qikyt.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 22 \u00a0ELF\u7b26\u53f7\u8868<\/p>\n<h4 id=\"4.4%20Hello.o%E7%9A%84%E7%BB%93%E6%9E%9C%E8%A7%A3%E6%9E%90\">4.4 Hello.o\u7684\u7ed3\u679c\u89e3\u6790<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">objdump -d -r hello.o \u00a0\u5206\u6790hello.o\u7684\u53cd\u6c47\u7f16&#xff0c;\u5e76\u8bf7\u4e0e\u7b2c3\u7ae0\u7684 hello.s\u8fdb\u884c\u5bf9\u7167\u5206\u6790\u3002<\/p>\n<ul>\n<li style=\"text-align:justify\">\u673a\u5668\u6307\u4ee4&#xff1a;\u673a\u5668\u8bed\u8a00\u7531\u4e8c\u8fdb\u5236\u6570\u6784\u6210&#xff0c;\u7ed3\u6784\u4e3a\u64cd\u4f5c\u4ee3\u7801&#043;\u64cd\u4f5c\u6570\u3002\u673a\u5668\u8bed\u8a00\u4e3a\u5c0f\u7aef\u5230\u5927\u7aef\u8868\u793a&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u6620\u5c04\u5173\u7cfb&#xff1a;\u673a\u5668\u8bed\u8a00\u7684\u64cd\u4f5c\u4ee3\u7801\u5bf9\u5e94\u6c47\u7f16\u8bed\u8a00\u7684\u64cd\u4f5c&#xff0c;\u800c\u64cd\u4f5c\u6570\u90e8\u5206\u5bf9\u5e94\u6c47\u7f16\u8bed\u8a00\u7684\u6e90\u64cd\u4f5c\u6570\u6216\u76ee\u6807\u64cd\u4f5c\u6570&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u64cd\u4f5c\u6570\u5f62\u5f0f&#xff1a;\u6c47\u7f16\u8bed\u8a00\u4e2d\u64cd\u4f5c\u6570\u4e3a$\u52a0\u4e00\u4e2a\u5341\u8fdb\u5236\u6570&#xff0c;\u800c\u673a\u5668\u8bed\u8a00\u4e2d\u7684\u64cd\u4f5c\u6570\u4e3a16\u8fdb\u5236\u8868\u793a&#xff0c;\u5e26\u67090x\u524d\u7f00&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5206\u652f\u8f6c\u79fb\u3001\u51fd\u6570\u8c03\u7528&#xff1a;\u5728\u6c47\u7f16\u8bed\u8a00\u4e2d&#xff0c;\u5206\u652f\u8f6c\u79fb\u4ee5\u53ca\u51fd\u6570\u8c03\u7528\u6d89\u53ca\u5230\u7684\u8df3\u8f6c\u90fd\u6709\u6bcf\u4e2a\u884c\u4e3a\u81ea\u8eab\u7684\u64cd\u4f5c\u6307\u4ee4&#xff0c;\u6bd4\u5982jne\u3001jl\u3001call\u3001ret\u7b49&#xff1b;\u800c\u5728\u673a\u5668\u8bed\u8a00\u4e2d&#xff0c;\u5730\u5740\u8df3\u8f6c\u64cd\u4f5c\u90fd\u4f1a\u8f6c\u5316\u4e3a\u4e8c\u8fdb\u5236\u64cd\u4f5c\u4ee3\u7801&#xff0c;\u4e0d\u540c\u4ee3\u7801\u4e4b\u95f4\u7684\u533a\u5206\u66f4\u4f9d\u9760\u8df3\u8f6c\u7684\u76ee\u6807\u5730\u5740\u4f4d\u7f6e&#xff08;\u76f8\u5bf9\u5730\u5740\u3001\u5bc4\u5b58\u5668\u3001\u5185\u5b58\u7b49&#xff09;\u4ee5\u53ca\u8df3\u8f6c\u7684\u504f\u79fb\u5927\u5c0f\u3002\u6240\u4ee5\u76f8\u540c\u7684\u673a\u5668\u8df3\u8f6c\u6307\u4ee4\u4ee3\u7801\u53ef\u80fd\u4ee3\u8868\u4e86\u4e0d\u540c\u7684\u64cd\u4f5c\u3002\u6700\u540e&#xff0c;\u6c47\u7f16\u8bed\u8a00\u4e2d&#xff0c;\u8df3\u8f6c\u7684\u76ee\u6807\u4e3a\u67d0\u4e2a\u6807\u8bb0\u4f4d\u7f6e&#xff08;\u5982\u56fe\u4e2d\u7684.L1 .L2 .L3&#xff09;&#xff0c;\u800c\u673a\u5668\u6307\u4ee4\u662f\u8df3\u8f6c\u5230\u67d0\u4e2a\u5177\u4f53\u5730\u5740\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10kpulqvo3sxo.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10g4pabtwkuli.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 23 \u00a0hello.s&#xff08;\u5de6&#xff09;\u4e0ehello.o\u53cd\u6c47\u7f16&#xff08;\u53f3&#xff09;\u6bd4\u8f83<\/p>\n<h4 id=\"4.5%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">4.5 \u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u8fdb\u884c\u4e86\u673a\u5668\u6307\u4ee4\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u7684\u751f\u6210&#xff0c;\u5e76\u4e14\u7740\u91cd\u5229\u7528\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u67e5\u770b\u5176ELF\u683c\u5f0f\u6587\u4ef6\u4ee5\u53ca\u8fdb\u884c\u53cd\u6c47\u7f16\u3002\u901a\u8fc7\u5206\u6790\u5176ELF\u683c\u5f0f\u6587\u4ef6&#xff0c;\u6211\u4eec\u4e86\u89e3\u4e86\u8282\u5934\u3001\u91cd\u5b9a\u4f4d\u8282\u3001\u7b26\u53f7\u8868\u8fd9\u4e9b\u6210\u5206&#xff0c;\u66f4\u5bf9\u91cd\u5b9a\u4f4d\u8fdb\u884c\u4e86\u8be6\u7ec6\u7684\u5206\u6790\u3002\u6700\u540e\u901a\u8fc7\u5bf9\u6bd4hello.o\u7684\u53cd\u6c47\u7f16\u6587\u4ef6\u548chello.s\u6587\u4ef6&#xff0c;\u5f97\u5230\u4e86\u6c47\u7f16\u8bed\u53e5\u548c\u673a\u5668\u8bed\u8a00\u7684\u6620\u5c04\u5173\u7cfb\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC5%E7%AB%A0%20%E9%93%BE%E6%8E%A5\" style=\"text-align:center\">\u7b2c5\u7ae0 \u94fe\u63a5<\/h3>\n<h4 id=\"5.1%20%E9%93%BE%E6%8E%A5%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8\">5.1 \u94fe\u63a5\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h4>\n<ul>\n<li style=\"text-align:justify\">\u94fe\u63a5\u7684\u6982\u5ff5&#xff1a;\u4f7f\u7528\u201c\u6e90.o\u201d\u6587\u4ef6\u751f\u6210\u201c\u6e90\u201d\u6587\u4ef6&#xff08;\u53ef\u6267\u884c\u7a0b\u5e8f&#xff09;\u3002\u8fd9\u4e2a\u9636\u6bb5\u662f\u6574\u4e2a\u7a0b\u5e8f\u7531\u4ee3\u7801\u53d8\u6210\u80fd\u591f\u8fd0\u884c\u6d41\u7a0b\u7684\u6700\u540e\u4e00\u6b65\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d&#xff0c;\u94fe\u63a5\u5668\u4f1a\u5c06\u4e00\u4e2a\u6216\u591a\u4e2a\u76ee\u6807\u6587\u4ef6&#xff08;\u5982 hello.o&#xff09;\u4e0e\u6240\u9700\u7684\u5e93\u6587\u4ef6\u7ec4\u5408\u8d77\u6765&#xff0c;\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/li>\n<li style=\"text-align:justify\">\u94fe\u63a5\u7684\u4f5c\u7528&#xff1a;\u94fe\u63a5\u5341\u5206\u7075\u6d3b&#xff0c;\u53ef\u4ee5\u6267\u884c\u4e0e\u591a\u4e2a\u9636\u6bb5&#xff0c;\u4e5f\u6b63\u56e0\u4e3a\u94fe\u63a5\u5668\u7684\u5b58\u5728&#xff0c;\u4f7f\u5f97\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5927\u578b\u7684\u7a0b\u5e8f\u6a21\u5757\u5316&#xff0c;\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u5206\u79bb\u7f16\u8bd1&#xff0c;\u5c24\u5176\u662f\u5728\u9700\u8981\u4fee\u6539\u67d0\u4e2a\u5927\u578b\u7a0b\u5e8f\u7684\u67d0\u4e00\u4e2a\u6a21\u5757\u65f6\u6216\u5728\u67d0\u51e0\u4e2a\u7a0b\u5e8f\u4f7f\u7528\u4e86\u76f8\u540c\u7684\u5e93\u6587\u4ef6\u65f6\u6709\u663e\u8457\u7684\u5f71\u54cd\u3002\u94fe\u63a5\u5668\u5177\u4f53\u7684\u4f5c\u7528\u5305\u62ec\u7b26\u53f7\u89e3\u6790\u3001\u5730\u5740\u5206\u914d\u4e0e\u91cd\u5b9a\u4f4d\u3001\u5408\u5e76\u76ee\u6807\u6587\u4ef6\u3001\u94fe\u63a5\u5e93\u6587\u4ef6\u3001\u751f\u6210\u53ef\u6267\u884c\u683c\u5f0f\u7b49\u3002<\/li>\n<\/ul>\n<h4 id=\"5.2%20%E5%9C%A8Ubuntu%E4%B8%8B%E9%93%BE%E6%8E%A5%E7%9A%84%E5%91%BD%E4%BB%A4\">5.2 \u5728Ubuntu\u4e0b\u94fe\u63a5\u7684\u547d\u4ee4<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u624b\u52a8\u94fe\u63a5\u7684\u5b9e\u73b0\u547d\u4ee4&#xff08;\u5305\u542b\u6307\u5b9a\u52a8\u6001\u94fe\u63a5\u5668\u3001\u94fe\u63a5hello.o\u3001\u542f\u52a8\u6587\u4ef6\u3001\u52a8\u6001\u94fe\u63a5\u4f9d\u8d56\u6587\u4ef6&#xff09;&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">ld -dynamic-linker \/lib64\/ld-linux-x86-64.so.2 \\\\<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\/usr\/lib\/x86_64-linux-gnu\/crt1.o \\\\<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\/usr\/lib\/x86_64-linux-gnu\/crti.o \\\\<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">hello.o -lc \\\\<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\/usr\/lib\/x86_64-linux-gnu\/crtn.o \\\\<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">-o hello<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-101oq22oviajj.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u56fe 24 \u00a0\u624b\u52a8\u94fe\u63a5\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n<h4 id=\"5.3%20%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6hello%E7%9A%84%E6%A0%BC%E5%BC%8F\">5.3 \u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6hello\u7684\u683c\u5f0f<\/h4>\n<ul>\n<li style=\"text-align:justify\">ELF\u5934&#xff1a;\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6hello\u4e2d&#xff0c;ELF\u5934\u7684TYPE\u3001\u5165\u53e3\u70b9\u5730\u5740\u3001\u7a0b\u5e8f\u5934\u8d77\u70b9\u7b49\u4f1a\u6709\u4e0d\u540c\u3002\u5982\u56fe<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10eluowosd2xk.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 25 \u00a0\u53ef\u6267\u884c\u7a0b\u5e8fELF\u5934<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7a0b\u5e8f\u5934&#xff08;\u6bb5&#xff09;&#xff1a;\u5728\u76ee\u6807\u6587\u4ef6(hello.o)\u4e2d\u5e76\u6ca1\u6709\u6bb5\u4fe1\u606f&#xff0c;\u901a\u8fc7\u53ef\u6267\u884c\u7a0b\u5e8f&#xff0c;\u53ef\u4ee5\u83b7\u5f97\u5404\u6bb5\u7684\u7c7b\u578b\u3001\u8d77\u59cb\u5730\u5740\u3001\u5927\u5c0f\u7b49\u4fe1\u606f&#xff0c;\u89c1\u4e0b\u56fe&#xff1a;<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10noylq1zlahq.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-100fdwhtuaakk.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 26 \u00a0\u7a0b\u5e8f\u5934&#xff08;\u6bb5&#xff09;\u4fe1\u606f<\/p>\n<ul>\n<li style=\"text-align:justify\">\u8282\u8868&#xff1a;\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u8282\u8868\u4f1a\u5c06\u67d0\u4e9b\u8c03\u8bd5\u7b26\u53f7\u3001\u94fe\u63a5\u7b26\u53f7\u53bb\u9664&#xff0c;\u56e0\u6b64\u4f1a\u6bd4\u76ee\u6807\u6587\u4ef6\u7684\u8282\u8868\u5185\u5bb9\u7565\u5c11&#xff0c;\u5728\u6b64\u4e0d\u505a\u5c55\u793a\u3002<\/li>\n<li style=\"text-align:justify\">\u52a8\u6001\u8282&#xff1a;\u76ee\u6807\u6587\u4ef6ELF\u683c\u5f0f\u540c\u6837\u6ca1\u6709\u52a8\u6001\u8282&#xff0c;\u53ef\u6267\u884c\u6587\u4ef6\u7684\u52a8\u6001\u8282\u90e8\u5206\u53ef\u4ee5\u544a\u8bc9loader\u8981\u52a0\u8f7d\u54ea\u4e9b\u5171\u4eab\u5e93&#xff1b;\u6307\u660e\u51fd\u6570\u91cd\u5b9a\u4f4d\u8868&#xff08;\u5982 GOT\u3001PLT&#xff09;\u7684\u5730\u5740&#xff0c;\u4ee5\u4fbf\u4e8eloader \u6839\u636e\u8fd9\u4e9b\u5730\u5740\u66ff\u6362\u51fd\u6570\u8c03\u7528\u8df3\u8f6c\u4f4d\u7f6e&#xff1b;\u8fd8\u4f1a\u4e3a dlopen()\u3001dlsym()\u00a0\u8fd9\u4e9b\u8fd0\u884c\u65f6\u8c03\u7528\u673a\u5236\u63d0\u4f9b\u7b26\u53f7\u652f\u6301&#xff1b;\u5e76\u4e14\u53ef\u4ee5\u63d0\u9ad8\u5171\u4eab\u5e93\u7684\u7075\u6d3b\u6027\u4e0e\u91cd\u7528\u6027&#xff0c;\u4f8b\u5982\u591a\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u540c\u65f6\u5171\u4eab libc.so.6&#xff0c;\u53ea\u9700\u52a0\u8f7d\u4e00\u6b21\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10azzy1uywjz0.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 27 \u00a0\u52a8\u6001\u8868\u4fe1\u606f<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7b26\u53f7\u8868&#xff1a;\u7b26\u53f7\u8868\u6709\u4e24\u7c7b&#xff0c;.symtab&#xff08;\u7b26\u53f7\u8868&#xff09;\u548c .strtab&#xff08;\u5b57\u7b26\u4e32\u8868&#xff09;\u4ee5\u53ca.dynsym&#xff08;\u52a8\u6001\u7b26\u53f7\u8868&#xff09;\u548c .dynstr&#xff08;\u52a8\u6001\u5b57\u7b26\u4e32\u8868&#xff09;\u3002\u76ee\u6807\u6587\u4ef6\u901a\u5e38\u5305\u542b\u5168\u90e8\u7684\u4e24\u7c7b&#xff0c;\u800c\u53ef\u6267\u884c\u6587\u4ef6\u4e00\u822c\u53ea\u5305\u542b\u540e\u9762\u7684.dynsym\u548c.dynstr\u90e8\u5206\u3002\u5f53\u6211\u4eec\u4f7f\u7528gcc -s hello.c -o hello1\u4ee5\u53cagcc hello.c -o hello2\u65f6&#xff0c;\u5206\u522b\u8c03\u53d6\u7b26\u53f7\u8868\u5206\u6790\u53ef\u77e5&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u5265\u79bb\u53ef\u6267\u884c\u6587\u4ef6\u7684\u7b26\u53f7\u8868\u4ee5\u8fbe\u5230\u51cf\u5c0f\u6587\u4ef6\u4f53\u79ef\u5e76\u4fdd\u62a4\u7b26\u53f7\u4fe1\u606f\u7684\u529f\u80fd\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10wkaa1lu44sc.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 28 \u00a0hello2\u7684\u7b26\u53f7\u8868<\/p>\n<h4 id=\"5.4%20hello%E7%9A%84%E8%99%9A%E6%8B%9F%E5%9C%B0%E5%9D%80%E7%A9%BA%E9%97%B4\">5.4 hello\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ece\u56fe26\u89c2\u5bdf\u7a0b\u5e8f\u5934LOAD\u7684\u8d77\u59cb\u5730\u5740&#xff0c;\u5f97\u5230\u53ef\u52a0\u8f7d\u7a0b\u5e8f\u6bb5\u7684\u5730\u5740\u4e3a0x400000\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u4ece\u5730\u57400x400000\u5f00\u59cb\u52300x401000\u88ab\u8f7d\u5165&#xff0c;\u865a\u62df\u5730\u5740\u4ece0x400fff\u7ed3\u675f\u3002\u6839\u636e\u8282\u5934\u8868&#xff0c;\u53ef\u4ee5\u901a\u8fc7edb\u627e\u5230\u5404\u6bb5\u7684\u4fe1\u606f\u3002\u4f7f\u7528edb\u5de5\u5177\u7684Data Dump\u7a97\u53e3\u89c2\u5bdf\u53ef\u6267\u884c\u7a0b\u5e8f\u52a0\u8f7d\u5230\u865a\u62df\u5730\u5740\u7684\u60c5\u51b5&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\"><img decoding=\"async\" alt=\"\" src=\"2025-06-1042sewu4bkiv.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10vtvpocon15r.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 29 \u00a0\u8282\u5934\u4e0eedb Data Dump\u7a97\u53e30x401000-0x402000<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6211\u4eec\u53ef\u4ee5\u627e\u5230\u5982.text\u8282\u7684\u4fe1\u606f&#xff1a;\u53ef\u4ee5\u5bf9\u6bd4\u5176\u673a\u5668\u7801\u5185\u5bb9\u9a8c\u8bc1\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-1014qpafuwry5.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10hcz5bmqbwy0.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 30 \u00a0.text\u8282\u7684edb\u865a\u62df\u5730\u5740\u4fe1\u606f\u53ca\u9a8c\u8bc1<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5176\u4ed6\u8282\u5747\u53ef\u4ee5\u901a\u8fc7\u6b64\u65b9\u5f0f\u83b7\u5f97\u5176\u865a\u62df\u5730\u5740\u7a7a\u95f4\u3002<\/p>\n<h4 id=\"5.5%20%E9%93%BE%E6%8E%A5%E7%9A%84%E9%87%8D%E5%AE%9A%E4%BD%8D%E8%BF%87%E7%A8%8B%E5%88%86%E6%9E%90\">5.5 \u94fe\u63a5\u7684\u91cd\u5b9a\u4f4d\u8fc7\u7a0b\u5206\u6790<\/h4>\n<h5 id=\"5.5.1%20%E9%93%BE%E6%8E%A5%E7%9A%84%E8%BF%87%E7%A8%8B\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">5.5.1 \u94fe\u63a5\u7684\u8fc7\u7a0b<\/h5>\n<ul>\n<li style=\"text-align:justify\">\u7f16\u8bd1\u9636\u6bb5&#xff1a;\u5148\u901a\u8fc7gcc\u751f\u6210\u76ee\u6807\u6587\u4ef6hello.o&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u94fe\u63a5\u9636\u6bb5&#xff08;\u751f\u6210\u52a8\u6001\u53ef\u6267\u884c\u6587\u4ef6&#xff09;&#xff1a;\u901a\u8fc7\u5bf9\u6bd4\u56fe29\u4e0e\u56fe30&#xff0c;\u53ef\u4ee5\u53d1\u73b0&#xff0c;\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5f00\u5934\u6dfb\u52a0\u4e86.plt\u8df3\u677f&#xff0c;\u9996\u6b21\u8c03\u7528\u65f6\u901a\u8fc7.plt\u8df3\u677f\u8df3\u8f6c\u81f3\u94fe\u63a5\u5668\u51fd\u6570\u8fdb\u884c\u5b9e\u9645\u5730\u5740\u67e5\u627e&#xff0c;\u540e\u7eed\u8c03\u7528\u76f4\u63a5\u8df3\u8f6c\u81f3\u6b63\u786e\u7684printf\u5b9e\u73b0\u3002\u4ee5\u6211\u4eec\u7684hello.c\u7a0b\u5e8fprintf\u4e3a\u4f8b&#xff0c;\u94fe\u63a5\u5668\u4f1a\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:justify\">\u68c0\u67e5\u7a0b\u5e8f\u4e2d\u7684\u7b26\u53f7&#xff08;\u5982printf&#xff09;&#xff0c;\u53d1\u73b0\u672a\u5b9a\u4e49&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u4ece\u6807\u51c6\u5171\u4eab\u5e93&#xff08;\u5982\/lib\/x86_64-linux-gnu\/libc.so.6&#xff09;\u4e2d\u627e\u5230printf\u662flibc\u7684\u4e00\u4e2a\u5bfc\u51fa\u7b26\u53f7&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u4fdd\u7559\u8fd9\u4e9b\u7b26\u53f7\u4e3a\u201c\u52a8\u6001\u7b26\u53f7\u201d&#xff0c;\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u4e0d\u5199\u5165\u5b9e\u9645\u5730\u5740&#xff0c;\u800c\u662f\u7559\u4e00\u4e2a\u91cd\u5b9a\u4f4d\u9879&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u5199\u5165.plt\u6bb5&#xff08;\u5ef6\u8fdf\u7ed1\u5b9a\u8df3\u677f\u8868&#xff09;\u3001.got\u6bb5&#xff08;\u5b9e\u9645\u8c03\u7528\u5730\u5740\u8df3\u677f&#xff09;\u3001.dynamic, .dynsym, .dynstr, .rela.plt\u7b49\u8f85\u52a9\u6bb5&#xff08;\u7528\u4e8e\u52a8\u6001\u94fe\u63a5&#xff09;&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5199\u5165\u9700\u8981\u4f9d\u8d56\u7684\u5171\u4eab\u5e93\u5217\u8868&#xff08;\u5982NEEDED libc.so.6&#xff09;\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10qd5s3p2xsb4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 31 \u00a0hello.o\u53cd\u6c47\u7f16\u7684\u8d77\u59cb\u90e8\u5206<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px\">\u00a0<img decoding=\"async\" alt=\"\" src=\"2025-06-105m5uelyl1xu.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 32 \u00a0hello\u53cd\u6c47\u7f16\u8d77\u59cb\u90e8\u5206<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5&#xff1a;\u76ee\u6807\u6587\u4ef6\u4e2d&#xff0c;\u52a8\u6001\u94fe\u63a5\u5668\u4f1a\u4fdd\u7559\u5bf9printf\u7684\u5f15\u7528&#xff0c;\u4e0d\u4f1a\u89e3\u6790\u6210\u5177\u4f53\u5730\u5740&#xff0c;\u5e76\u4e14\u63d2\u5165 .got.plt&#xff0c;\u4e3a\u8fd0\u884c\u65f6\u201c\u5ef6\u8fdf\u586b\u5730\u5740\u201d\u7559\u4f4d\u7f6e&#xff1b;\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d&#xff0c;\u94fe\u63a5\u5668\u5219\u4f1a\u521d\u59cb\u5316 .got.plt\u00a0\u4e2d printf\u00a0\u7684\u4f4d\u7f6e\u4ee5\u4f9b\u8df3\u8f6c&#xff0c;\u8fd9\u4e2a\u8fc7\u7a0b\u7684\u8fa8\u8bc6\u5982\u56fe30\u4ee5\u53ca\u56fe31&#xff0c;\u6d41\u7a0b\u5982\u4e0b&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:justify\">\u7a0b\u5e8f\u52a0\u8f7d\u540e&#xff0c;ld-linux.so\u52a8\u6001\u94fe\u63a5\u5668\u5f00\u59cb\u5de5\u4f5c&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5b83\u67e5\u627e\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u8bb0\u5f55\u7684.dynamic\u6bb5&#xff0c;\u786e\u5b9a\u6240\u9700\u5171\u4eab\u5e93&#xff0c;\u5e76\u52a0\u8f7d\u5bf9\u5e94.so\u6587\u4ef6&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u67e5\u627e.rela.plt\u4e2d\u7684\u91cd\u5b9a\u4f4d\u9879&#xff0c;\u5bf9.got\u8868\u8fdb\u884c\u586b\u5145&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5f53\u7a0b\u5e8f\u7b2c\u4e00\u6b21\u8c03\u7528printf\u65f6&#xff0c;\u8df3\u8f6c\u5230.plt\u4e2d\u7684\u5ef6\u8fdf\u7ed1\u5b9a\u8df3\u677f&#xff0c;\u8be5\u8df3\u677f\u8c03\u7528\u52a8\u6001\u94fe\u63a5\u5668&#xff0c;\u67e5\u627e\u5b9e\u9645\u5730\u5740&#xff0c;\u4e00\u65e6\u627e\u5230&#xff0c;\u4f1a\u4fee\u6539.got\u8868\u4e2d\u8be5\u9879&#xff0c;\u4ee5\u540e\u518d\u8c03\u7528\u5c31\u76f4\u63a5\u8df3\u8f6c&#xff0c;\u65e0\u9700\u518d\u67e5\u627e&#xff08;\u5ef6\u8fdf\u7ed1\u5b9a\u673a\u5236&#xff09;\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-105hqltsyezpl.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10fkzismhiont.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-105g5b2r5cep4.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-10jxhoqvn0pak.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 33 \u00a0printf\u51fd\u6570\u5728\u76ee\u6807\u6587\u4ef6\u548c\u53ef\u6267\u884c\u7a0b\u5e8f\u5185\u7684\u4e0d\u540c\u4f53\u73b0<\/p>\n<h5 id=\"5.5.2%20%E9%87%8D%E5%AE%9A%E4%BD%8D%E5%88%86%E6%9E%90\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:justify\">5.5.2 \u91cd\u5b9a\u4f4d\u5206\u6790<\/h5>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">hello.o\u7684\u91cd\u5b9a\u4f4d\u9879\u76ee\u5982\u4e0b\u56fe&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10t1klg1g0uk0.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 34 \u00a0hello.o\u7684\u91cd\u5b9a\u4f4d\u8868<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u52a8\u6001\u94fe\u63a5\u7684\u6d41\u7a0b&#xff08;\u4ee5printf\u4e3a\u4f8b&#xff09;\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7f16\u8bd1\u9636\u6bb5&#xff1a;\u7f16\u8bd1\u5668\u53ea\u751f\u6210\u8c03\u7528\u7b26\u53f7puts\u3001exit\u7b49\u7684\u4f2a\u5730\u5740&#xff0c;\u4f8b\u5982\u4f7f\u7528call puts&#064;PLT&#xff0c;\u4f46\u5b9e\u9645\u5730\u5740\u672a\u77e5&#xff0c;\u56e0\u6b64\u63d2\u5165\u4e00\u4e2a\u91cd\u5b9a\u4f4d\u9879&#xff08;\u5982\u4f60\u770b\u5230\u7684 R_X86_64_PLT32 puts-4\u00a0\u56fe32\u4e2d\u9ec4\u8272\u865a\u7ebf\u5708\u51fa&#xff09;&#xff0c;\u5e76\u4fdd\u5b58\u5728.o\u6587\u4ef6\u7684\u91cd\u5b9a\u4f4d\u8868\u4e2d\u3002<\/li>\n<li style=\"text-align:justify\">\u94fe\u63a5\u9636\u6bb5&#xff08;ld\u52a8\u6001\u94fe\u63a5&#xff09;&#xff1a;\u94fe\u63a5\u5668\u4e0d\u4f1a\u5c06\u8fd9\u4e9b\u51fd\u6570\u5730\u5740\u76f4\u63a5\u586b\u5165\u673a\u5668\u7801\u4e2d&#xff0c;\u800c\u662f\u4fdd\u7559call puts&#064;PLT\u6307\u4ee4\u4e0d\u53d8&#xff0c;\u5728\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6&#xff08;\u5982hello&#xff09;\u4e2d\u6784\u9020.plt\u548c.got.plt\u8868&#xff0c;\u968f\u540e\u4fee\u6539.got.plt\u8868&#xff0c;\u4f7f\u4e4b\u5728\u7a0b\u5e8f\u542f\u52a8\u65f6\u6307\u5411.plt\u4e2d\u7684\u5ef6\u8fdf\u7ed1\u5b9a\u903b\u8f91\u3002<\/li>\n<li style=\"text-align:justify\">\u7a0b\u5e8f\u8fd0\u884c\u65f6&#xff08;\u7531\u52a8\u6001\u94fe\u63a5\u5668ld.so\u8d1f\u8d23&#xff09;&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:justify\">\u7b2c\u4e00\u6b21\u8c03\u7528puts\u65f6&#xff0c;\u8fdb\u5165.plt\u4e2d\u7684\u8df3\u677f\u4ee3\u7801&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u8df3\u677f\u53d1\u73b0.got.plt\u4e2d\u5730\u5740\u5c1a\u672a\u521d\u59cb\u5316&#xff0c;\u8f6c\u800c\u8df3\u5230\u52a8\u6001\u94fe\u63a5\u5668&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u52a8\u6001\u94fe\u63a5\u5668\u67e5\u627e\u771f\u6b63\u7684puts\u51fd\u6570\u5730\u5740&#xff0c;\u5e76\u5c06\u5176\u5199\u56de.got.plt&#xff1b;<\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ee5\u540e\u518d\u6b21\u8c03\u7528puts\u65f6\u5c31\u4e0d\u518d\u8fdb\u5165\u8df3\u677f&#xff0c;\u800c\u662f\u76f4\u63a5\u8df3\u5230\u771f\u6b63\u5730\u5740\u3002<\/p>\n<h4 id=\"5.6%20hello%E7%9A%84%E6%89%A7%E8%A1%8C%E6%B5%81%E7%A8%8B\">5.6 hello\u7684\u6267\u884c\u6d41\u7a0b<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.6.1 \u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528GDB\u8fdb\u884c\u8c03\u8bd5&#xff0c;\u5e76\u5728_start\u5904\u8bbe\u7f6e\u65ad\u70b9&#xff1b;\u5728\u6b64\u51fd\u6570\u4e2d&#xff0c;\u4f1a\u8df3\u8f6c\u5230__libc_start_main\u51fd\u6570&#xff08;\u5730\u5740\u4e3a0x7ffff7de5081)&#xff0c;\u540c\u65f6\u5c06main\u51fd\u6570\u5730\u57400x4011d6\u4f20\u53c2\u7ed9__libc_start_main&#xff0c;\u5728\u8be5\u51fd\u6570\u4e2d&#xff0c;\u4f1a\u8fdb\u884ccallq *%rax \u00a0# main\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10dcboyjbt0pt.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 35 \u00a0\u52a0\u8f7dHello\u7a0b\u5e8f<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10znxgkswe05p.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-105ub2zo5tohq.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 36 \u00a0__libc_start_main\u5230main\u7684\u8df3\u8f6c<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728main\u51fd\u6570\u4e2d&#xff0c;\u5bf9\u4e8e\u4e00\u4e2a\u5408\u6cd5\u8f93\u5165&#xff0c;\u6267\u884c\u5206\u522b\u7ecf\u8fc7printf\u3001sleep\u3001atoi\u3001getchar&#xff0c;\u8f93\u5165enter\u6267\u884c\u8fc7\u540e&#xff0c;\u7a0b\u5e8f\u4f1a\u56de\u5230__libc_start_main&#xff0c;\u5e76\u5f88\u5feb\u8fdb\u5165__GI_exit\u51fd\u6570&#xff0c;\u5e76\u6700\u540e\u9000\u51fa\u7a0b\u5e8f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.6.2 \u7a0b\u5e8f\u6267\u884c\u5b50\u7a0b\u5e8f\u53ca\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6d41\u7a0b\u53ca\u5730\u5740\u603b\u7ed3\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">_start:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0x4010f0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0__libc_start_main: \u00a0\u00a0\u00a00x7ffff7de4f90<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0main:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0x4011d6<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0__printf:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00x7ffff7e22c90 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0__sleep:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0x7ffff7ea3dc0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0__GI_atoi:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00x7ffff7e05bb0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0getchar:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00x7ffff7e4c560 \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0__libc_start_main:\u00a0 \u00a0 \u00a00x7ffff7de4f90 \u00a0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0__GI_exit:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0x7ffff7e07a40<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u2192\u00a0\u00a0\u9000\u51fa<\/p>\n<h4 id=\"5.7%20Hello%E7%9A%84%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5%E5%88%86%E6%9E%90\">5.7 Hello\u7684\u52a8\u6001\u94fe\u63a5\u5206\u6790<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u52a8\u6001\u94fe\u63a5\u7684\u76ee\u7684\u662f\u5c06\u4e00\u4e2a\u5927\u578b\u7a0b\u5e8f\u62c6\u5206\u4e3a\u6570\u4e2a\u8f83\u5c0f\u7684\u6a21\u5757\u5206\u522b\u5904\u7406&#xff0c;\u5728\u6700\u540e\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u65f6\u8fdb\u884c\u94fe\u63a5\u5f62\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u7a0b\u5e8f\u3002\u5728\u52a8\u6001\u94fe\u63a5\u524d&#xff0c;\u7f16\u8bd1\u5668\u6ca1\u6709\u529e\u6cd5\u9884\u6d4b\u8fd9\u4e2a\u51fd\u6570\u7684\u8fd0\u884c\u65f6\u5730\u5740&#xff0c;\u56e0\u4e3a\u5b9a\u4e49\u5b83\u7684\u5171\u4eab\u6a21\u5757\u5728\u8fd0\u884c\u65f6\u53ef\u4ee5\u52a0\u8f7d\u5230\u4efb\u610f\u4f4d\u7f6e\u3002\u5ef6\u8fdf\u7ed1\u5b9a\u662f\u901a\u8fc7GOT\u548cPLT\u5b9e\u73b0\u7684&#xff0c;\u5728\u52a8\u6001\u94fe\u63a5\u524d\u540e&#xff0c;\u6211\u4eec\u6765\u5206\u6790.got.plt\u7684\u6570\u503c\u53d8\u5316\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ecehello\u7a0b\u5e8f\u7684elf\u683c\u5f0f\u6587\u4ef6\u4e2d\u6211\u4eec\u53ef\u4ee5\u5f97\u5230&#xff0c;.got.plt\u8282\u7684\u8d77\u59cb\u5730\u5740\u4e3a0x404000&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10234zqdvpg50.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 37 \u00a0.got.plt\u8282\u4fe1\u606f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728_dl_fixup\u51fd\u6570\u6267\u884c\u524d\u540e&#xff0c;0x404000\u5185\u5bb9\u4e3a&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10wswagezlnbh.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 38 \u00a0\u52a8\u6001\u94fe\u63a5\u524d\u540e.got.plt\u4e00\u90e8\u5206\u6570\u503c\u53d8\u5316<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d&#xff0c;\u5e93\u51fd\u6570\u7684\u8c03\u7528\u901a\u5e38\u91c7\u7528\u4e00\u79cd\u95f4\u63a5\u8df3\u8f6c\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u52a8\u6001\u94fe\u63a5\u3002\u7b2c\u4e00\u6b21\u8c03\u7528\u67d0\u4e2a\u5e93\u51fd\u6570\u65f6&#xff0c;\u7a0b\u5e8f\u5e76\u4e0d\u4f1a\u7acb\u523b\u8df3\u8f6c\u5230\u8be5\u51fd\u6570\u7684\u771f\u5b9e\u5730\u5740&#xff0c;\u800c\u662f\u5148\u901a\u8fc7\u4e00\u6bb5\u4e2d\u8f6c\u4ee3\u7801\u8df3\u8f6c\u5230\u94fe\u63a5\u5668\u3002\u94fe\u63a5\u5668\u8d1f\u8d23\u5728\u8fd0\u884c\u65f6\u67e5\u627e\u8be5\u51fd\u6570\u5728\u5171\u4eab\u5e93\u4e2d\u7684\u5b9e\u9645\u5730\u5740&#xff0c;\u5e76\u5c06\u8fd9\u4e2a\u5730\u5740\u5199\u5165\u4e00\u4e2a\u8df3\u8f6c\u8868\u4e2d\u3002\u8fd9\u6837&#xff0c;\u540e\u7eed\u5bf9\u540c\u4e00\u4e2a\u51fd\u6570\u7684\u8c03\u7528\u5c31\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u8fd9\u4e2a\u8868\u8df3\u8f6c\u5230\u6b63\u786e\u7684\u51fd\u6570\u4f4d\u7f6e&#xff0c;\u65e0\u9700\u518d\u6b21\u67e5\u8be2&#xff0c;\u4ece\u800c\u517c\u987e\u4e86\u7a0b\u5e8f\u542f\u52a8\u65f6\u7684\u6548\u7387\u548c\u8fd0\u884c\u65f6\u7684\u7075\u6d3b\u6027\u3002\u8fd9\u4e00\u673a\u5236\u662f\u5b9e\u73b0\u5ef6\u8fdf\u7ed1\u5b9a\u548c\u52a8\u6001\u94fe\u63a5\u7684\u5173\u952e\u3002<\/p>\n<h4 id=\"5.8%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">5.8 \u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u4e3b\u8981\u5bf9\u94fe\u63a5\u73af\u8282\u8fdb\u884c\u4e86\u975e\u5e38\u8be6\u7ec6\u7684\u5206\u89e3\u5206\u6790&#xff0c;\u5305\u62ec\u8fde\u63a5\u524d\u540e\u4ea7\u751f\u7684\u53d8\u5316&#xff0c;\u9488\u5bf9\u76ee\u6807\u6587\u4ef6\u548c\u53ef\u6267\u884c\u6587\u4ef6\u8fdb\u884c\u4e86\u5bf9\u6bd4\u3002\u540c\u65f6\u5bf9\u91cd\u5b9a\u4f4d\u3001\u7a0b\u5e8f\u8fd0\u884c\u7684\u6d41\u7a0b\u4ee5\u53ca\u52a8\u6001\u94fe\u63a5\u7684\u5b9e\u73b0\u8fdb\u884c\u4e86\u62c6\u89e3\u5206\u6790&#xff0c;\u66f4\u6e05\u695a\u7684\u5c55\u73b0\u4e86\u53ef\u6267\u884c\u7a0b\u5e8f\u751f\u6210\u8fc7\u7a0b\u4e2d\u865a\u62df\u5730\u5740\u7a7a\u95f4\u7684\u5206\u914d\u548c\u4f7f\u7528\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC6%E7%AB%A0%20hello%E8%BF%9B%E7%A8%8B%E7%AE%A1%E7%90%86\" style=\"text-align:center\">\u7b2c6\u7ae0 hello\u8fdb\u7a0b\u7ba1\u7406<\/h3>\n<h4 id=\"6.1%20%E8%BF%9B%E7%A8%8B%E7%9A%84%E6%A6%82%E5%BF%B5%E4%B8%8E%E4%BD%9C%E7%94%A8\">6.1 \u8fdb\u7a0b\u7684\u6982\u5ff5\u4e0e\u4f5c\u7528<\/h4>\n<ul>\n<li style=\"text-align:justify\">\u8fdb\u7a0b\u7684\u6982\u5ff5&#xff1a;\u8fdb\u7a0b\u662f\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f&#xff0c;\u662f\u64cd\u4f5c\u7cfb\u7edf\u8d44\u6e90\u5206\u914d\u548c\u8c03\u5ea6\u7684\u57fa\u672c\u5355\u4f4d\u3002\u4e00\u4e2a\u8fdb\u7a0b\u62e5\u6709\u81ea\u5df1\u7684\u5730\u5740\u7a7a\u95f4\u3001\u4ee3\u7801\u3001\u6570\u636e\u6bb5\u3001\u5806\u6808\u548c\u4e00\u7ec4\u76f8\u5173\u7684\u7cfb\u7edf\u8d44\u6e90\u3002\u5b83\u53ef\u4ee5\u4e0e\u5176\u4ed6\u8fdb\u7a0b\u5e76\u53d1\u6267\u884c&#xff0c;\u662f\u64cd\u4f5c\u7cfb\u7edf\u5b9e\u73b0\u591a\u4efb\u52a1\u7684\u91cd\u8981\u57fa\u7840\u3002<\/li>\n<li style=\"text-align:justify\">\u8fdb\u7a0b\u7684\u4f5c\u7528&#xff1a;\u5b9e\u73b0\u591a\u4efb\u52a1\u5e76\u53d1\u6267\u884c&#xff1b;\u63d0\u9ad8 CPU \u5229\u7528\u7387\u4e0e\u7cfb\u7edf\u541e\u5410\u91cf&#xff1b;\u652f\u6301\u8d44\u6e90\u72ec\u7acb\u4e0e\u5b89\u5168\u9694\u79bb&#xff1b;\u652f\u6301\u7cfb\u7edf\u670d\u52a1\u4e0e\u7528\u6237\u7a0b\u5e8f\u7684\u5e76\u884c\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<h4 id=\"6.2%20%E7%AE%80%E8%BF%B0%E5%A3%B3Shell-bash%E7%9A%84%E4%BD%9C%E7%94%A8%E4%B8%8E%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B\">6.2 \u7b80\u8ff0\u58f3Shell-bash\u7684\u4f5c\u7528\u4e0e\u5904\u7406\u6d41\u7a0b<\/h4>\n<li style=\"text-align:justify\">\u58f3Shell-bash\u7684\u4f5c\u7528&#xff1a;Shell\u662f\u7528\u6237\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u95f4\u7684\u6865\u6881&#xff0c;\u662f\u4e00\u79cd\u547d\u4ee4\u89e3\u91ca\u5668\u3002\u7528\u6237\u8f93\u5165\u547d\u4ee4\u540e&#xff0c;Shell\u4f1a\u8fdb\u884c\u89e3\u6790\u3001\u67e5\u627e\u53ef\u6267\u884c\u6587\u4ef6\u3001\u521b\u5efa\u5b50\u8fdb\u7a0b\u3001\u52a0\u8f7d\u7a0b\u5e8f\u5e76\u6267\u884c\u3002<\/li>\n<li style=\"text-align:justify\">\u5904\u7406\u6d41\u7a0b&#xff1a;<\/li>\n<ul>\n<li style=\"text-align:justify\">\u7528\u6237\u5728\u7ec8\u7aef\u8f93\u5165\u547d\u4ee4&#xff1a;\u4f8b\u5982\u00a0.\/hello 202311699\u00a0\u4e01\u61ff\u00a015734597159 1&#xff1b;<\/li>\n<li style=\"text-align:justify\">Shell \u89e3\u6790\u547d\u4ee4\u884c&#xff0c;\u5c06\u5b57\u7b26\u4e32\u5206\u89e3\u4e3a\u547d\u4ee4\u53ca\u53c2\u6570&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff08;fork&#xff09;&#xff0c;\u5728\u5b50\u8fdb\u7a0b\u4e2d\u8c03\u7528execve\u6267\u884c\u76ee\u6807\u7a0b\u5e8f&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u7236\u8fdb\u7a0b\u7b49\u5f85\u5b50\u8fdb\u7a0b\u7ed3\u675f&#xff08;\u901a\u8fc7wait\/waitpid&#xff09;&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5b50\u8fdb\u7a0b\u6267\u884c\u7ed3\u675f&#xff0c;\u8fd4\u56de\u7ed3\u679c\u7ed9Shell&#xff0c;Shell\u663e\u793a\u8f93\u51fa\u5e76\u51c6\u5907\u4e0b\u4e00\u6b21\u4ea4\u4e92\u3002<\/li>\n<\/ul>\n<h4 id=\"6.3%20Hello%E7%9A%84fork%E8%BF%9B%E7%A8%8B%E5%88%9B%E5%BB%BA%E8%BF%87%E7%A8%8B\">6.3 Hello\u7684fork\u8fdb\u7a0b\u521b\u5efa\u8fc7\u7a0b<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u5728bash\u4e2d\u8fd0\u884c.\/hello\u65f6&#xff0c;Shell\u4f1a\u6267\u884c\u6307\u4ee4pid_t pid &#061; fork()\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b&#xff0c;\u8be5\u5b50\u8fdb\u7a0b\u590d\u5236\u4e86\u7236\u8fdb\u7a0b\u7684\u5927\u90e8\u5206\u4e0a\u4e0b\u6587&#xff08;\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u6808\u7b49&#xff09;&#xff1b;\u5b50\u8fdb\u7a0b\u83b7\u5f97\u4e00\u4e2a\u65b0\u7684 PID&#xff0c;\u8fdb\u5165\u5c31\u7eea\u6001&#xff0c;\u7b49\u5f85CPU\u8c03\u5ea6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u7236\u8fdb\u7a0b\u4e2d&#xff0c;fork\u8fd4\u56de\u5b50\u8fdb\u7a0b\u7684PID,\u800c\u5728\u5b50\u8fdb\u7a0b\u4e2dfork\u8fd4\u56de0&#xff0c;\u8fd4\u56de\u503c\u63d0\u4f9b\u4e00\u4e2a\u660e\u786e\u7684\u65b9\u6cd5\u6765\u5206\u8fa8\u7a0b\u5e8f\u662f\u7236\u8fdb\u7a0b\u8fd8\u662f\u5728\u5b50\u8fdb\u7a0b\u4e2d\u6267\u884c\u3002<\/p>\n<h4 id=\"6.4%20Hello%E7%9A%84execve%E8%BF%87%E7%A8%8B\">6.4 Hello\u7684execve\u8fc7\u7a0b<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521b\u5efa\u5b50\u8fdb\u7a0b\u540e&#xff0c;Shell\u4f7f\u7528execve()\u7cfb\u7edf\u8c03\u7528\u5c06\u5f53\u524d\u5b50\u8fdb\u7a0b\u7684\u6620\u50cf\u66ff\u6362\u4e3ahello\u7a0b\u5e8f\u7684\u6620\u50cf&#xff1a;execve(&#034;.\/hello&#034;, argv, envp)&#xff1b;\u539f\u6709bash\u5b50\u8fdb\u7a0b\u7684\u4ee3\u7801\u548c\u6570\u636e\u88ab\u65b0\u7684hello\u7a0b\u5e8f\u66ff\u6362&#xff1b;PID\u4fdd\u6301\u4e0d\u53d8&#xff0c;\u4f46\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u3001\u6808\u88ab\u91cd\u65b0\u52a0\u8f7d&#xff1b;\u8fdb\u5165\u7528\u6237\u6001\u7ee7\u7eed\u6267\u884chello\u7684main()\u51fd\u6570\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-1044a4y4qdngb.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 39 \u00a0\u5185\u5b58\u5206\u5e03\u56fe[3]<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u5b50\u8fdb\u7a0b\u6267\u884c execve(&#034;.\/hello&#034;, argv, envp)\u00a0\u65f6&#xff0c;\u4f1a\u4ece\u7528\u6237\u6001\u5207\u6362\u5230\u5185\u6838\u6001&#xff0c;\u8fdb\u5165\u5185\u6838\u4e2d\u7684 sys_execve()&#xff08;\u6216 do_execve()&#xff09;\u51fd\u6570\u3002\u63a5\u4e0b\u6765\u4f1a\u67e5\u627e\u548c\u9a8c\u8bc1\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u9a8c\u8bc1\u901a\u8fc7\u5219\u4f1a\u6e05\u7a7a\u5f53\u524d\u8fdb\u7a0b\u7684\u7528\u6237\u7a7a\u95f4\u5185\u5b58&#xff0c;\u5305\u62ec&#xff1a;\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u548c\u6808&#xff0c;\u968f\u540e\u52a0\u8f7dhello\u7a0b\u5e8f\u7684\u4ee3\u7801\u548c\u6570\u636e\u5230\u76f8\u5e94\u5185\u5b58\u533a\u57df&#xff0c;\u5b8c\u6210\u5185\u5b58\u9875\u9762\u7684\u5206\u914d\u548c\u6620\u5c04\u3002<\/p>\n<h4 id=\"6.5%20Hello%E7%9A%84%E8%BF%9B%E7%A8%8B%E6%89%A7%E8%A1%8C\">6.5 Hello\u7684\u8fdb\u7a0b\u6267\u884c \u00a0<\/h4>\n<li style=\"text-align:justify\">\u8fdb\u7a0b\u751f\u547d\u5468\u671f&#xff1a;\u5f53hello\u7a0b\u5e8f\u88abexecve\u6210\u529f\u52a0\u8f7d\u540e&#xff0c;\u8fdb\u7a0b\u8fdb\u5165\u6b63\u5f0f\u8fd0\u884c\u9636\u6bb5\u3002\u5b83\u5728\u6574\u4e2a\u751f\u547d\u5468\u671f\u4e2d&#xff0c;\u4f1a\u7ecf\u5386\u5982\u4e0b\u51e0\u79cd\u72b6\u6001&#xff1a;\u5c31\u7eea\u6001&#xff08;\u7b49\u5f85\u88ab\u8c03\u5ea6\u5230CPU\u4e0a\u6267\u884c&#xff09;\u3001\u8fd0\u884c\u6001&#xff08;\u5360\u7528CPU\u6b63\u5728\u6267\u884c&#xff09;\u3001\u963b\u585e\u6001&#xff08;\u7b49\u5f85\u67d0\u4e2a\u4e8b\u4ef6&#xff0c;\u5982sleep()&#xff09;\u3001\u7ec8\u6b62\u6001&#xff08;\u6267\u884c\u5b8c\u6bd5\u6216\u6536\u5230\u7ec8\u6b62\u4fe1\u53f7&#xff09;&#xff0c;\u8fd9\u4e9b\u72b6\u6001\u8f6c\u6362\u7531\u64cd\u4f5c\u7cfb\u7edf\u7684\u8fdb\u7a0b\u8c03\u5ea6\u5668&#xff08;Scheduler&#xff09;\u6839\u636e\u4f18\u5148\u7ea7\u3001\u65f6\u95f4\u7247\u7b49\u7b56\u7565\u63a7\u5236\u3002<\/li>\n<li style=\"text-align:justify\">\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff1a;\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u6709\u4e00\u4e2a\u4e0a\u4e0b\u6587\u4fe1\u606f\u96c6\u5408&#xff0c;\u8868\u793a\u8be5\u8fdb\u7a0b\u5728\u67d0\u4e00\u65f6\u523b\u7684\u8fd0\u884c\u72b6\u6001&#xff0c;\u5305\u542b&#xff1a;\u7528\u6237\u4e0a\u4e0b\u6587&#xff08;\u7a0b\u5e8f\u8ba1\u6570\u5668\u3001\u5bc4\u5b58\u5668\u503c\u3001\u5806\u6808\u6307\u9488\u7b49&#xff09;\u3001\u6838\u5fc3\u4e0a\u4e0b\u6587&#xff08;\u7cfb\u7edf\u8c03\u7528\u65f6&#xff0c;\u4fdd\u5b58\u5185\u6838\u5806\u6808\u3001\u7cfb\u7edf\u8c03\u7528\u53c2\u6570\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u8868\u3001\u8c03\u5ea6\u4fe1\u606f\u7b49&#xff09;\u548c\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u4e2d\u7ef4\u62a4\u6bcf\u4e2a\u8fdb\u7a0b\u7684\u5168\u5c40\u4fe1\u606f&#xff09;\u3002\u5f53\u8c03\u5ea6\u53d1\u751f\u65f6&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u4fdd\u5b58\u65e7\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff0c;\u52a0\u8f7d\u65b0\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff0c;\u4ece\u800c\u5b9e\u73b0\u8fdb\u7a0b\u5207\u6362\u3002<\/li>\n<li style=\"text-align:justify\">\u65f6\u95f4\u7247\u4e0e\u8c03\u5ea6\u8fc7\u7a0b&#xff1a;\u65f6\u95f4\u7247\u662f\u6bcf\u4e2a\u8fdb\u7a0b\u80fd\u8fde\u7eed\u5360\u7528CPU\u7684\u6700\u957f\u65f6\u95f4\u6bb5\u3002Linux\u4e2d&#xff0c;\u8c03\u5ea6\u5668&#xff08;\u5982CFS&#xff09;\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u5206\u914d\u65f6\u95f4\u7247&#xff0c;\u8c03\u5ea6\u6d41\u7a0b\u5982\u4e0b&#xff08;\u4ee5hello.c\u6587\u4ef6\u4e3a\u4f8b&#xff09;&#xff1a;<\/li>\n<ul>\n<li style=\"text-align:justify\">hello\u8fdb\u7a0b\u4ece\u5c31\u7eea\u961f\u5217\u4e2d\u88ab\u8c03\u5ea6\u5668\u9009\u4e2d&#xff0c;\u5206\u914dCPU&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u5f00\u59cb\u6267\u884c&#xff0c;\u8c03\u7528printf()\u8f93\u51fa\u5185\u5bb9&#xff0c;\u7531\u7528\u6237\u6001\u8fdb\u5165\u5185\u6838\u6001&#xff0c;\u7ed3\u675f\u540e\u8fd4\u56de\u7528\u6237\u6001&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u6267\u884csleep(n)\u7cfb\u7edf\u8c03\u7528&#xff0c;\u6b64\u65f6\u8fdb\u7a0b\u8fdb\u5165\u963b\u585e\u6001&#xff0c;\u653e\u5f03CPU&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u8c03\u5ea6\u5176\u4ed6\u8fdb\u7a0b\u8fd0\u884c&#xff0c;\u8fdb\u5165\u5185\u6838\u6001&#xff1b;<\/li>\n<li style=\"text-align:justify\">sleep\u65f6\u95f4\u7ed3\u675f&#xff0c;hello\u88ab\u5524\u9192&#xff0c;\u8fd4\u56de\u7528\u6237\u6001&#xff0c;\u56de\u5230\u5c31\u7eea\u961f\u5217&#xff0c;\u7b49\u5f85\u518d\u6b21\u88ab\u8c03\u5ea6\u8fd0\u884c&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u91cd\u590d\u4ee5\u4e0a\u8fc7\u7a0b\u76f4\u81f3\u8fd0\u884c\u5b8c10\u6b21printf()&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u8c03\u7528getchar()&#xff0c;\u7b49\u5f85\u7528\u6237\u8f93\u5165&#xff08;\u963b\u585e&#xff09;&#xff0c;\u8fdb\u5165\u5185\u6838\u6001&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u7528\u6237\u6309\u56de\u8f66\u540e&#xff0c;hello\u7ed3\u675f&#xff0c;\u8fdb\u5165\u7ec8\u6b62\u6001\u3002<\/li>\n<\/ul>\n<h4 id=\"6.6%20hello%E7%9A%84%E5%BC%82%E5%B8%B8%E4%B8%8E%E4%BF%A1%E5%8F%B7%E5%A4%84%E7%90%86\">6.6 hello\u7684\u5f02\u5e38\u4e0e\u4fe1\u53f7\u5904\u7406<\/h4>\n<p style=\"text-align:justify\">1. \u5f02\u5e38\u79cd\u7c7b\u4e0e\u4fe1\u53f7\u7684\u4ea7\u751f&#xff1a;<\/p>\n<table border=\"1\" style=\"margin-left:1.6500pt;width:431.6500pt\">\n<tbody>\n<tr>\n<td style=\"vertical-align:center;width:66.5000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u5f02\u5e38\u7c7b\u522b<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:130.3000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u539f\u56e0<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:76.5500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u5f02\u6b65\/\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:150.8000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u8fd4\u56de\u884c\u4e3a<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:66.5000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4e2d\u65ad<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:130.3000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6765\u81eaI\/O\u8bbe\u5907\u7684\u4fe1\u53f7<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:76.5500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u5f02\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:150.8000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u603b\u662f\u8fd4\u56de\u5230\u4e0b\u4e00\u6761\u6307\u4ee4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:66.5000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u9677\u9631<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:130.3000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6709\u610f\u7684\u5f02\u5e38<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:76.5500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:150.8000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u603b\u662f\u8fd4\u56de\u5230\u4e0b\u4e00\u6761\u6307\u4ee4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:66.5000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6545\u969c<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:130.3000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6f5c\u5728\u53ef\u6062\u590d\u7684\u9519\u8bef<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:76.5500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:150.8000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53ef\u80fd\u8fd4\u56de\u5230\u5f53\u524d\u7684\u6307\u4ee4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:66.5000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7ec8\u6b62<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:130.3000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4e0d\u53ef\u6062\u590d\u7684\u9519\u8bef<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:76.5500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u540c\u6b65<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:150.8000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4e0d\u4f1a\u8fd4\u56de<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align:center\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u8868 1 \u00a0\u5f02\u5e38\u7c7b\u578b\u53ca\u5176\u89e6\u53d1\u4fe1\u53f7<\/p>\n<table border=\"1\" style=\"margin-left:2.6500pt\">\n<tbody>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4fe1\u53f7<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u503c<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4ea7\u751f\u539f\u56e0<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u9ed8\u8ba4\u884c\u4e3a<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGINT<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">2<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7528\u6237\u6309\u4e0b Ctrl&#043;C<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4e2d\u65ad\u8fdb\u7a0b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGTSTP<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">20<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7528\u6237\u6309\u4e0b Ctrl&#043;Z<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6302\u8d77\u8fdb\u7a0b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGTERM<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">15<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4f7f\u7528 kill\u00a0\u547d\u4ee4\u53d1\u9001\u7ec8\u6b62\u8bf7\u6c42<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7ec8\u6b62\u8fdb\u7a0b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGSEGV<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">11<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u5185\u5b58\u975e\u6cd5\u8bbf\u95ee&#xff08;\u5982\u8bbf\u95ee\u7a7a\u6307\u9488\u3001\u672a\u5206\u914d\u5185\u5b58&#xff09;<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6bb5\u9519\u8bef\u7ec8\u6b62<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGALRM<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">14<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">sleep()\u00a0\u8d85\u65f6\u5185\u90e8\u4f9d\u8d56<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u9ed8\u8ba4\u7ec8\u6b62<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGHUP<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">1<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7ec8\u7aef\u65ad\u5f00\u3001\u63a7\u5236\u7ec8\u7aef\u5173\u95ed<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7ec8\u6b62\u8fdb\u7a0b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:center;width:62.2500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">SIGPIPE<\/p>\n<\/td>\n<td style=\"vertical-align:center;width:33.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">13<\/p>\n<\/td>\n<td style=\"width:361px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u5411\u5df2\u5173\u95ed\u7684\u7ba1\u9053\u5199\u5165\u6570\u636e<\/p>\n<\/td>\n<td style=\"width:172px\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u7ec8\u6b62\u8fdb\u7a0b<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u8868 2 \u00a0\u4fe1\u53f7\u79cd\u7c7b\u53ca\u5176\u4ea7\u751f\u539f\u56e0\u4e0e\u884c\u4e3a<\/p>\n<p style=\"text-align:justify\">2. \u5f02\u5e38\u4fe1\u53f7\u7684\u5904\u7406&#xff1a;<\/p>\n<ul>\n<li style=\"text-align:justify\">\u4e2d\u65ad&#xff1a;\u68c0\u6d4b\u5230\u4e2d\u65ad\u4fe1\u53f7\u65f6&#xff0c;\u7a0b\u5e8f\u7acb\u5373\u54cd\u5e94&#xff0c;\u5b8c\u6210\u5f53\u524d\u6307\u4ee4\u540e&#xff0c;\u6267\u884c\u4e2d\u65ad\u5904\u7406\u4f8b\u7a0b&#xff0c;\u5b8c\u6210\u540e\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6761\u6307\u4ee4&#xff1b;<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10vwdnohzhjzw.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe40 \u00a0\u4e2d\u65ad\u5904\u7406[1]<\/p>\n<ul>\n<li style=\"text-align:justify\">\u9677\u9631&#xff1a;\u7a0b\u5e8f\u4e3b\u52a8\u89e6\u53d1&#xff0c;\u5982\u7cfb\u7edf\u8c03\u7528&#xff0c;\u6267\u884c\u7279\u5b9a\u5904\u7406\u4f8b\u7a0b\u540e\u8fd4\u56de\u539f\u6307\u4ee4&#xff1b;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10w34rokgmiww.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 41 \u00a0\u9677\u9631\u5904\u7406[1]<\/p>\n<ul>\n<li style=\"text-align:justify\">\u6545\u969c&#xff1a;\u68c0\u6d4b\u5230\u6545\u969c\u4fe1\u53f7\u65f6&#xff0c;\u7a0b\u5e8f\u5c1d\u8bd5\u4fee\u590d\u9519\u8bef&#xff0c;\u82e5\u53ef\u6062\u590d\u5219\u7ee7\u7eed\u6267\u884c\u5f53\u524d\u6307\u4ee4&#xff0c;\u5426\u5219\u5904\u7406\u7a0b\u5e8f\u8fd4\u56de\u5230\u5185\u6838\u4e2d\u7684abort\u4f8b\u7a0b&#xff0c;abort\u4f8b\u7a0b\u4f1a\u7ec8\u6b62\u5f15\u8d77\u7684\u6545\u969c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10g24fkvfc4kh.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 42 \u6545\u969c\u5904\u7406[1]<\/p>\n<ul>\n<li style=\"text-align:justify\">\u7ec8\u6b62&#xff1a;\u6536\u5230\u7ec8\u6b62\u4fe1\u53f7\u540e&#xff0c;\u7a0b\u5e8f\u65e0\u6761\u4ef6\u7ed3\u675f\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10hu1uwjmq3vb.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 43 \u00a0\u7ec8\u6b62\u5904\u7406[1]<\/p>\n<p style=\"text-align:justify\">3. \u5f02\u5e38\u64cd\u4f5c\u8fd0\u884c\u4ee5\u53ca\u7ed3\u679c&#xff1a;<\/p>\n<ul>\n<li>Ctrl-C&#xff1a;\u4e2d\u65ad\u4fe1\u53f7&#xff0c;\u63a7\u5236\u7a0b\u5e8f\u505c\u6b62\u6267\u884c&#xff1b;<img decoding=\"async\" alt=\"\" src=\"2025-06-10cs1ym5n43rb.png\" \/><\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe44 \u00a0Ctrl-C\u4fe1\u53f7\u8fd0\u884c\u7ed3\u679c<\/p>\n<ul>\n<li style=\"text-align:justify\">Ctrl-Z&#xff1a;\u6302\u8d77\u8fdb\u7a0b&#xff0c;\u6682\u505c\u6267\u884c&#xff0c;\u53ef\u7528fg\u6062\u590d&#xff1b;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10v3wywr3dhul.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 45 \u00a0Ctrl-Z&#043;fg\u4fe1\u53f7\u8fd0\u884c\u7ed3\u679c<\/p>\n<ul>\n<li style=\"text-align:justify\">Ctrl-Z&#043;ps&#043;jobs&#043;bg&#xff1a;\u6302\u8d77\u8fdb\u7a0b&#xff0c;\u6682\u505c\u6267\u884c&#xff0c;\u67e5\u770b\u5f53\u524d\u540e\u53f0\u4efb\u52a1&#xff0c;\u6062\u590d\u6302\u8d77\u8fdb\u7a0b\u81f3\u540e\u53f0\u8fd0\u884c&#xff1b;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10qufk4zabmmf.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 46 \u00a0Ctrl-Z&#043;ps&#043;jobs&#043;bg<\/p>\n<ul>\n<li style=\"text-align:justify\">pstree&#xff1a;<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-1032uxyz1s03e.png\" \/><img decoding=\"async\" alt=\"\" src=\"2025-06-102v4c2ucl0e4.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 47 \u00a0pstree\u8fd0\u884c\u7ed3\u679c<\/p>\n<ul>\n<li style=\"text-align:justify\">kill&#xff1a;\u201c\u6740\u6b7b\u201d\u7a0b\u5e8f\u3002\u53ef\u4ee5\u6dfb\u52a0-SIGINT\u5f3a\u5236\u7ec8\u6b62\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"2025-06-10ootghwtkrdz.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 48 \u00a0kill\u7ec8\u6b62<\/p>\n<h4 id=\"6.7%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">6.7 \u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u4ecb\u7ecd\u4e86\u4e00\u4e2a\u6267\u884c\u6587\u4ef6\u5728shell\u4e2d\u6267\u884c\u6574\u4e2a\u8fdb\u7a0b\u7684\u6d41\u7a0b&#xff0c;\u5305\u62ec\u521b\u5efa\u5b50\u8fdb\u7a0b\u3001\u52a0\u8f7d\u3001\u6267\u884c\u3001\u53ef\u80fd\u8fdb\u884c\u5f02\u5e38\u5904\u7406\u7b49\u6b65\u9aa4\u3002\u6700\u540e\u4f7f\u7528hello\u6267\u884c\u6587\u4ef6\u8fdb\u884c\u5f02\u5e38\u5904\u7406\u6d4b\u8bd5&#xff0c;\u4f7f\u7528\u4e86Ctrl-C\u3001Ctrl-Z\u3001kill\u7b49\u547d\u4ee4&#xff0c;\u9a8c\u8bc1\u4e86\u4fe1\u53f7\u5904\u7406\u673a\u5236&#xff0c;\u5c55\u793a\u4e86\u8fdb\u7a0b\u5728\u4e0d\u540c\u4fe1\u53f7\u4e0b\u7684\u54cd\u5e94\u884c\u4e3a&#xff0c;\u8fdb\u4e00\u6b65\u9a8c\u8bc1\u4e86\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u5f02\u5e38\u4fe1\u53f7\u7684\u7cbe\u786e\u63a7\u5236\u548c\u9ad8\u6548\u5904\u7406\u80fd\u529b&#xff0c;\u786e\u4fdd\u7cfb\u7edf\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%AC%AC7%E7%AB%A0%20hello%E7%9A%84%E5%AD%98%E5%82%A8%E7%AE%A1%E7%90%86\" style=\"text-align:center\">\u7b2c7\u7ae0 hello\u7684\u5b58\u50a8\u7ba1\u7406<\/h3>\n<h4 id=\"7.1%20hello%E7%9A%84%E5%AD%98%E5%82%A8%E5%99%A8%E5%9C%B0%E5%9D%80%E7%A9%BA%E9%97%B4\">7.1 hello\u7684\u5b58\u50a8\u5668\u5730\u5740\u7a7a\u95f4<\/h4>\n<ul>\n<li style=\"text-align:justify\">\u903b\u8f91\u5730\u5740&#xff1a;\u903b\u8f91\u5730\u5740\u662f\u7f16\u8bd1\u5668\u770b\u5230\u7684\u5730\u5740&#xff0c;\u7531\u6bb5\u5bc4\u5b58\u5668 &#043; \u504f\u79fb\u91cf\u7ec4\u6210&#xff0c;\u5f62\u5f0f\u4e3a (\u6bb5\u9009\u62e9\u5b50&#xff1a;offset)\u3002\u4f8b\u5982&#xff0c;\u5728hello\u4e2d&#xff0c;CPU\u6267\u884cprintf\u6240\u5728\u6307\u4ee4\u65f6&#xff0c;\u6307\u4ee4\u4f4d\u4e8e.text\u6bb5\u4e2d&#xff0c;\u6570\u636e&#xff08;\u5b57\u7b26\u4e32\u5e38\u91cf&#xff09;\u4f4d\u4e8e.rodata\u6bb5\u4e2d&#xff0c;\u5982\u679c\u6bb5\u9009\u62e9\u5b50\u662fDS&#xff0c;\u504f\u79fb\u91cf\u662f0x1234&#xff0c;\u5219\u903b\u8f91\u5730\u5740\u4e3a (DS:0x1234)\u3002<\/li>\n<li style=\"text-align:justify\">\u7ebf\u6027\u5730\u5740&#xff1a;\u903b\u8f91\u5730\u5740\u7ecf\u8fc7\u6bb5\u5f0f\u7ba1\u7406\u540e\u5f97\u5230\u7684\u5730\u5740&#xff0c;\u7ebf\u6027\u5730\u5740 &#061; \u6bb5\u57fa\u5740 &#043; \u504f\u79fb\u91cf\u3002\u800c\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf&#xff08;\u5982Linux&#xff09;\u91c7\u7528\u5e73\u5766\u5185\u5b58\u6a21\u5f0f&#xff1a;\u6bb5\u57fa\u5740\u5747\u4e3a 0&#xff0c;\u56e0\u6b64\u7ebf\u6027\u5730\u5740\u00a0&#061; \u504f\u79fb\u91cf&#xff0c;\u6240\u4ee5\u7a0b\u5e8f\u8bbf\u95ee &#034;Hello %s %s %s\\\\n&#034;\u00a0\u5b9e\u9645\u4e0a\u5c31\u662f\u8bbf\u95ee\u67d0\u4e2a\u7ebf\u6027\u5730\u5740\u3002<\/li>\n<li style=\"text-align:justify\">\u865a\u62df\u5730\u5740&#xff1a;\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u5206\u914d\u76844GB&#xff08;32\u4f4d&#xff09;\u6216\u66f4\u5927&#xff08;64\u4f4d&#xff09;\u7684\u5730\u5740\u7a7a\u95f4\u3002\u7ebf\u6027\u5730\u5740\u5c31\u662f\u8fdb\u7a0b\u770b\u5230\u7684\u865a\u62df\u5730\u5740\u3002\u5728hello\u4e2d&#xff0c;\u7a0b\u5e8f\u8bbf\u95ee\u7684\u5730\u5740&#xff08;\u59820x400654&#xff09;\u5c31\u662f\u865a\u62df\u5730\u5740&#xff0c;\u662f\u8fdb\u7a0b\u79c1\u6709\u7684&#xff0c;\u5e76\u4e14\u591a\u4e2a\u8fdb\u7a0b\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u865a\u62df\u5730\u5740\u800c\u4e92\u4e0d\u5f71\u54cd\u3002<\/li>\n<li style=\"text-align:justify\">\u7269\u7406\u5730\u5740&#xff1a;\u7269\u7406\u5730\u5740\u662f\u771f\u5b9e\u5b58\u5728\u4e8e\u7269\u7406\u5185\u5b58\u6761\u4e0a\u7684\u5730\u5740&#xff0c;\u7531MMU&#xff08;\u5185\u5b58\u7ba1\u7406\u5355\u5143&#xff09;\u5c06\u865a\u62df\u5730\u5740\u6620\u5c04\u800c\u6765\u3002\u5728hello\u4e2d&#xff0c;\u901a\u8fc7\u9875\u8868&#xff08;\u56db\u7ea7\u9875\u8868&#xff09;&#xff0c;\u865a\u62df\u5730\u57400x4011d6\u4f1a\u88ab\u6620\u5c04\u5230\u67d0\u4e2a\u7269\u7406\u5730\u5740\u3002<\/li>\n<\/ul>\n<h4 id=\"7.2%20Intel%E9%80%BB%E8%BE%91%E5%9C%B0%E5%9D%80%E5%88%B0%E7%BA%BF%E6%80%A7%E5%9C%B0%E5%9D%80%E7%9A%84%E5%8F%98%E6%8D%A2-%E6%AE%B5%E5%BC%8F%E7%AE%A1%E7%90%86\">7.2 Intel\u903b\u8f91\u5730\u5740\u5230\u7ebf\u6027\u5730\u5740\u7684\u53d8\u6362-\u6bb5\u5f0f\u7ba1\u7406<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u6bb5\u5f0f\u7ba1\u7406\u4e2d&#xff0c;\u7a0b\u5e8f\u88ab\u5212\u5206\u4e3a\u82e5\u5e72\u5177\u6709\u72ec\u7acb\u529f\u80fd\u7684\u6bb5&#xff0c;\u5982\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5171\u4eab\u6bb5\u7b49&#xff0c;\u6bcf\u4e2a\u6bb5\u7531\u6bb5\u63cf\u8ff0\u7b26\u8bb0\u5f55\u5176\u8d77\u59cb\u5730\u5740\u3001\u957f\u5ea6\u548c\u72b6\u6001\u3002\u8fd9\u4e9b\u63cf\u8ff0\u7b26\u96c6\u4e2d\u5b58\u653e\u5728\u6bb5\u63cf\u8ff0\u7b26\u8868\u4e2d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6&#xff0c;\u5176\u5730\u5740\u8bbf\u95ee\u4f9d\u8d56\u4e8e\u903b\u8f91\u5730\u5740\u7684\u7ed3\u6784&#xff0c;\u8be5\u5730\u5740\u7531\u4e24\u4e2a\u90e8\u5206\u7ec4\u6210&#xff1a;\u6bb5\u9009\u62e9\u7b26\u4e0e\u6bb5\u5185\u504f\u79fb\u91cf\u3002\u5176\u4e2d&#xff0c;\u6bb5\u9009\u62e9\u7b26\u662f\u4e00\u4e2a 16 \u4f4d\u7684\u503c&#xff0c;\u524d 13 \u4f4d\u7528\u4e8e\u7d22\u5f15\u6bb5\u63cf\u8ff0\u7b26\u8868\u4ee5\u5b9a\u4f4d\u7279\u5b9a\u6bb5&#xff0c;\u540e 3 \u4f4d\u5219\u6d89\u53ca\u4e0e\u786c\u4ef6\u5b9e\u73b0\u76f8\u5173\u7684\u6807\u5fd7\u548c\u6743\u9650\u63a7\u5236\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u903b\u8f91\u5730\u5740\u4e2d\u7684\u6bb5\u6807\u8bc6\u53ef\u88ab\u7528\u6765\u4ece\u6bb5\u63cf\u8ff0\u7b26\u8868\u4e2d\u5feb\u901f\u68c0\u7d22\u76ee\u6807\u6bb5\u7684\u4f4d\u7f6e\u548c\u5c5e\u6027\u3002\u5728 Intel \u67b6\u6784\u4e0b&#xff0c;\u6574\u4e2a\u7cfb\u7edf\u53ea\u7ef4\u62a4\u4e00\u5f20\u5168\u5c40\u63cf\u8ff0\u7b26\u8868&#xff08;GDT&#xff09;&#xff0c;\u5176\u4e2d\u5b58\u653e\u4e86\u64cd\u4f5c\u7cfb\u7edf\u5c42\u9762\u7684\u5173\u952e\u6bb5\u4fe1\u606f&#xff0c;\u5305\u62ec\u5185\u6838\u7684\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u6808\u6bb5\u4ee5\u53ca\u6307\u5411\u6bcf\u4e2a\u8fdb\u7a0b\u6216\u4efb\u52a1\u7684\u5c40\u90e8\u63cf\u8ff0\u7b26\u8868&#xff08;LDT&#xff09;\u7684\u6bb5\u63cf\u8ff0\u7b26\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6bcf\u4e00\u4e2a\u7528\u6237\u8fdb\u7a0b\u6216\u4efb\u52a1\u90fd\u62e5\u6709\u4e00\u5f20\u72ec\u7acb\u7684\u5c40\u90e8\u63cf\u8ff0\u7b26\u8868&#xff08;LDT&#xff09;&#xff0c;\u7528\u4e8e\u63cf\u8ff0\u8be5\u4efb\u52a1\u4e13\u5c5e\u7684\u6bb5\u5185\u5bb9\u3002\u8fd9\u4e9b\u63cf\u8ff0\u7b26\u8986\u76d6\u4e86\u8be5\u4efb\u52a1\u7684\u79c1\u6709\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u548c\u5806\u6808\u6bb5\u7b49&#xff0c;\u540c\u65f6\u4e5f\u5305\u542b\u4efb\u52a1\u95e8\u3001\u8c03\u7528\u95e8\u7b49\u95e8\u7c7b\u578b\u7684\u63cf\u8ff0\u7b26&#xff0c;\u4ee5\u652f\u6301\u4efb\u52a1\u5207\u6362\u6216\u8de8\u6bb5\u8c03\u7528\u7b49\u64cd\u4f5c\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10gtykm3sfrah.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 49 \u00a0\u6bb5\u5f0f\u7ba1\u7406\u2014\u2014\u5730\u5740\u8f6c\u6362<\/p>\n<h4 id=\"7.3%20Hello%E7%9A%84%E7%BA%BF%E6%80%A7%E5%9C%B0%E5%9D%80%E5%88%B0%E7%89%A9%E7%90%86%E5%9C%B0%E5%9D%80%E7%9A%84%E5%8F%98%E6%8D%A2-%E9%A1%B5%E5%BC%8F%E7%AE%A1%E7%90%86\">7.3 Hello\u7684\u7ebf\u6027\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u53d8\u6362-\u9875\u5f0f\u7ba1\u7406<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u865a\u62df\u5185\u5b58\u7cfb\u7edf\u5c06\u6574\u5757\u5730\u5740\u7a7a\u95f4\u89c6\u4e3a\u7531\u78c1\u76d8\u4e2d\u8fde\u7eed\u5b57\u8282\u5355\u5143\u6784\u6210\u7684\u4e00\u7ef4\u6570\u7ec4&#xff0c;\u603b\u5171\u5212\u5206\u4e3aN\u4e2a\u903b\u8f91\u5355\u5143\u3002\u8be5\u7a7a\u95f4\u88ab\u5212\u5206\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684\u7247\u6bb5&#xff0c;\u79f0\u4f5c\u865a\u62df\u9875&#xff1b;\u4e0e\u4e4b\u5bf9\u5e94&#xff0c;\u5b9e\u9645\u7684\u7269\u7406\u5185\u5b58\u4e5f\u6309\u7167\u76f8\u540c\u5927\u5c0f\u5212\u5206\u6210\u591a\u4e2a\u7269\u7406\u9875\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e3a\u4e86\u6620\u5c04\u548c\u7ba1\u7406\u865a\u62df\u9875&#xff0c;\u7cfb\u7edf\u7ef4\u62a4\u4e86\u4e00\u5f20\u9875\u8868&#xff0c;\u5b83\u662f\u7531\u591a\u4e2a\u9875\u8868\u9879&#xff08;Page Table Entry, PTE&#xff09;\u7ec4\u6210\u7684\u7ed3\u6784\u3002\u6bcf\u4e2aPTE\u901a\u5e38\u5305\u542b\u4e00\u4e2a\u6807\u5fd7\u4f4d&#xff08;\u8868\u793a\u8be5\u9875\u5f53\u524d\u662f\u5426\u9a7b\u7559\u4e8e\u4e3b\u5b58&#xff09;\u548c\u4e00\u4e2a\u5730\u5740\u5b57\u6bb5&#xff08;\u82e5\u6307\u660e\u9a7b\u7559&#xff0c;\u7269\u7406\u5185\u5b58\u4e2d\u8be5\u9875\u7684\u4f4d\u7f6e&#xff09;\u3002\u4e0b\u9762\u662f\u9875\u5f0f\u7ba1\u7406\u7684\u793a\u610f\u56fe<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10kz0grcxwaf5.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 50 \u00a0\u9875\u5f0f\u7ba1\u7406<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u4e00\u4e2a\u8fdb\u7a0b\u8bbf\u95ee\u67d0\u4e2a\u865a\u62df\u5730\u5740\u65f6&#xff0c;MMU&#xff08;\u5185\u5b58\u7ba1\u7406\u5355\u5143&#xff09;\u4f1a\u67e5\u9605\u9875\u8868\u5b8c\u6210\u865a\u62df\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u8f6c\u6362\u3002\u5982\u679c\u5bf9\u5e94\u7684\u9875\u8868\u9879\u663e\u793a\u8be5\u9875\u5c1a\u672a\u52a0\u8f7d\u81f3\u4e3b\u5b58&#xff0c;\u5373\u65e0\u6548&#xff0c;\u5219\u89e6\u53d1\u4e00\u6b21\u7f3a\u9875\u5f02\u5e38&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u8d1f\u8d23\u5c06\u5176\u4ece\u78c1\u76d8\u8c03\u5165\u5185\u5b58\u3002<\/p>\n<h4 id=\"7.4%20TLB%E4%B8%8E%E5%9B%9B%E7%BA%A7%E9%A1%B5%E8%A1%A8%E6%94%AF%E6%8C%81%E4%B8%8B%E7%9A%84VA%E5%88%B0PA%E7%9A%84%E5%8F%98%E6%8D%A2\">7.4 TLB\u4e0e\u56db\u7ea7\u9875\u8868\u652f\u6301\u4e0b\u7684VA\u5230PA\u7684\u53d8\u6362<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u8ba1\u7b97\u673a\u7cfb\u7edf\u4e2d&#xff0c;\u5730\u5740\u8f6c\u6362\u901a\u5e38\u7531\u4e13\u7528\u786c\u4ef6\u6a21\u5757\u5b8c\u6210&#xff0c;\u5176\u4e2d\u5173\u952e\u7684\u4e00\u73af\u662f\u4e00\u4e2a\u79f0\u4e3a\u7ffb\u8bd1\u540e\u5907\u7f13\u51b2\u533a\u7684\u9ad8\u901f\u7f13\u5b58\u7ed3\u6784\u3002TLB\u7528\u4e8e\u52a0\u901f\u865a\u62df\u5730\u5740\u5230\u7269\u7406\u5730\u5740\u7684\u6620\u5c04\u8fc7\u7a0b&#xff0c;\u5b83\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u7f13\u5b58\u9875\u8868\u9879&#xff08;PTE&#xff09;\u7684\u96c6\u5408&#xff0c;\u901a\u8fc7\u7f13\u5b58\u5e38\u7528\u9875\u7684\u6620\u5c04\u5173\u7cfb&#xff0c;\u907f\u514d\u9891\u7e41\u8bbf\u95ee\u4e3b\u5b58\u4e2d\u7684\u9875\u8868\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">TLB\u4ee5\u865a\u62df\u9875\u53f7&#xff08;VPN&#xff09;\u4f5c\u4e3a\u7d22\u5f15\u5173\u952e\u5b57&#xff0c;\u6bcf\u4e2a\u6761\u76ee\u5b58\u50a8\u4e00\u4e2a\u9875\u8868\u9879&#xff0c;\u5305\u62ec\u5bf9\u5e94\u7684\u7269\u7406\u9875\u53f7\u7b49\u4fe1\u606f\u3002\u4e3a\u5b9e\u73b0\u9ad8\u6548\u67e5\u627e&#xff0c;TLB\u591a\u91c7\u7528\u7ec4\u76f8\u8054\u7f13\u5b58\u7ed3\u6784\u3002\u5047\u8bbeTLB\u5305\u542b<img decoding=\"async\" alt=\"2^T\" class=\"mathcode\" src=\"2025-06-10nko5rrqeept.png\" \/>\u4e2a\u7ec4&#xff0c;\u5219\u4f7f\u7528VPN\u7684\u6700\u4f4eT\u4f4d\u4f5c\u4e3a\u7ec4\u53f7&#xff08;\u7d22\u5f15&#xff09;&#xff0c;\u800c\u9ad8\u4f4d\u4f5c\u4e3a\u6807\u7b7e\u8fdb\u884c\u5339\u914d\u64cd\u4f5c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u5904\u7406\u5668\u6267\u884c\u5730\u5740\u7ffb\u8bd1\u65f6&#xff0c;MMU\u9996\u5148\u5411TLB\u63d0\u4ea4\u5f53\u524d\u865a\u62df\u9875\u53f7&#xff0c;\u82e5\u627e\u5230\u5339\u914d\u9879&#xff0c;\u5373\u53d1\u751fTLB\u547d\u4e2d&#xff0c;\u5219\u76f4\u63a5\u63d0\u53d6\u5bf9\u5e94\u9875\u8868\u9879\u4e2d\u7684\u7269\u7406\u9875\u53f7&#xff08;PPN&#xff09;&#xff0c;\u5e76\u4e0e\u865a\u62df\u5730\u5740\u4e2d\u7684\u9875\u504f\u79fb&#xff08;VPO&#xff09;\u62fc\u63a5&#xff0c;\u7acb\u5373\u751f\u6210\u5b8c\u6574\u7684\u7269\u7406\u5730\u5740\u3002\u7531\u4e8e\u8be5\u8fc7\u7a0b\u5b8c\u5168\u5728\u82af\u7247\u5185\u90e8\u5b8c\u6210&#xff0c;\u65e0\u9700\u8bbf\u95ee\u5185\u5b58&#xff0c;\u56e0\u6b64\u901f\u5ea6\u6781\u5feb\u3002\u5982\u679c\u672a\u547d\u4e2dTLB&#xff0c;\u7cfb\u7edf\u5219\u56de\u9000\u81f3\u4f20\u7edf\u7684\u591a\u7ea7\u9875\u8868\u67e5\u8be2\u6d41\u7a0b&#xff0c;\u4ece\u5185\u5b58\u4e2d\u9010\u5c42\u89e3\u6790\u9875\u8868&#xff0c;\u76f4\u5230\u5b9a\u4f4d\u76ee\u6807\u7269\u7406\u9875\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10qf0eqcps3as.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 51 \u00a0\u56db\u7ea7\u9875\u8868\u4e0eTLB\u652f\u6301\u4e0bVA-PA\u8f6c\u6362<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e3a\u4e86\u8282\u7701\u5b58\u50a8\u7a7a\u95f4\u5e76\u652f\u6301\u66f4\u5927\u89c4\u6a21\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4&#xff0c;\u73b0\u4ee3\u7cfb\u7edf\u901a\u5e38\u4e0d\u518d\u4f7f\u7528\u5e73\u9762\u9875\u8868&#xff0c;\u800c\u662f\u91c7\u7528\u5206\u7ea7\u9875\u8868\u7ed3\u6784\u3002\u5728K\u7ea7\u9875\u8868\u8bbe\u8ba1\u4e2d&#xff0c;\u865a\u62df\u9875\u53f7\u88ab\u5212\u5206\u4e3aK\u4e2a\u90e8\u5206&#xff08;VPN1\u00a0~ VPNk&#xff09;&#xff0c;\u6bcf\u90e8\u5206\u7528\u4e8e\u7d22\u5f15\u5bf9\u5e94\u5c42\u7ea7\u7684\u9875\u8868\u6761\u76ee\u3002\u7b2c1\u5c42\u81f3\u7b2cK\u22121\u5c42\u7684PTE\u6307\u5411\u4e0b\u4e00\u5c42\u9875\u8868\u7684\u8d77\u59cb\u5730\u5740&#xff0c;\u800c\u6700\u540e\u4e00\u5c42\u7684PTE\u5219\u76f4\u63a5\u5b58\u50a8\u5b9e\u9645\u7684\u7269\u7406\u9875\u5e27\u53f7&#xff0c;\u6216\u5728\u9875\u4e0d\u9a7b\u7559\u4e3b\u5b58\u65f6\u5b58\u50a8\u5176\u5728\u78c1\u76d8\u4e2d\u7684\u4f4d\u7f6e\u3002<\/p>\n<h4 id=\"7.5%20%E4%B8%89%E7%BA%A7Cache%E6%94%AF%E6%8C%81%E4%B8%8B%E7%9A%84%E7%89%A9%E7%90%86%E5%86%85%E5%AD%98%E8%AE%BF%E9%97%AE\">7.5 \u4e09\u7ea7Cache\u652f\u6301\u4e0b\u7684\u7269\u7406\u5185\u5b58\u8bbf\u95ee<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u73b0\u4ee3\u5904\u7406\u5668\u4e2d&#xff0c;\u865a\u62df\u5730\u5740\u7ecf\u8fc7MMU\u8f6c\u6362\u4e3a\u7269\u7406\u5730\u5740\u540e&#xff0c;\u8bbf\u95ee\u6570\u636e\u65f6\u5e76\u4e0d\u4f1a\u76f4\u63a5\u8fdb\u5165\u4e3b\u5b58&#xff0c;\u800c\u662f\u4f18\u5148\u901a\u8fc7\u591a\u7ea7\u7f13\u5b58\u7cfb\u7edf\u4ee5\u63d0\u5347\u6548\u7387\u3002\u4ee5Intel\u00a0Core\u00a0i7\u4e3a\u4f8b&#xff0c;\u8be5\u5904\u7406\u5668\u91c7\u7528\u4e09\u7ea7\u7f13\u5b58\u67b6\u6784&#xff08;L1\u3001L2\u3001L3&#xff09;\u6765\u52a0\u901f\u5bf9\u7269\u7406\u5185\u5b58\u7684\u8bbf\u95ee\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6bcf\u6b21\u8bfb\u53d6\u6570\u636e&#xff0c;CPU\u9996\u5148\u5c06\u7269\u7406\u5730\u5740\u63d0\u4ea4\u7ed9L1\u7f13\u5b58\u67e5\u627e\u3002L1\u662f\u4e00\u7ec4\u76f8\u8054\u7f13\u5b58&#xff0c;\u5047\u8bbe\u5b83\u753164\u4e2a\u7ec4\u7ec4\u6210&#xff0c;\u6bcf\u7ec4\u542b8\u884c&#xff0c;\u6bcf\u884c\u7f13\u5b58\u4e00\u4e2a64\u5b57\u8282\u7684\u6570\u636e\u5757\u3002\u7269\u7406\u5730\u5740\u5728\u6b64\u88ab\u5206\u6210\u4e09\u90e8\u5206&#xff1a;\u4f4e6\u4f4d\u7528\u4e8e\u5757\u5185\u504f\u79fb&#xff0c;\u4e2d\u95f46\u4f4d\u7528\u4e8e\u9009\u62e9\u7f13\u5b58\u7ec4&#xff0c;\u9ad840\u4f4d\u5219\u4f5c\u4e3a\u6807\u7b7e\u7528\u4e8e\u8bc6\u522b\u6570\u636e\u662f\u5426\u5339\u914d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728L1\u4e2d\u67e5\u627e\u65f6&#xff0c;\u5148\u5b9a\u4f4d\u7ec4&#xff0c;\u518d\u5728\u8be5\u7ec4\u7684\u591a\u884c\u4e2d\u6bd4\u5bf9\u6807\u7b7e\u548c\u6709\u6548\u4f4d\u3002\u82e5\u627e\u5230\u5339\u914d\u6761\u76ee&#xff0c;\u5373\u53d1\u751f\u7f13\u5b58\u547d\u4e2d&#xff0c;\u6570\u636e\u4fbf\u53ef\u76f4\u63a5\u4ece\u7f13\u5b58\u8bfb\u53d6&#xff1b;\u82e5\u672a\u547d\u4e2d&#xff0c;\u5219\u9700\u5411\u66f4\u9ad8\u5c42\u7684\u7f13\u5b58&#xff08;L2&#xff09;\u8bf7\u6c42\u6570\u636e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">L2\u4e0eL1\u5de5\u4f5c\u539f\u7406\u76f8\u4f3c&#xff0c;\u4e5f\u91c7\u7528\u7ec4\u76f8\u8054\u7ed3\u6784\u3002\u5982\u679c\u6570\u636e\u5728L2\u4e5f\u65e0\u6cd5\u547d\u4e2d&#xff0c;\u63a5\u7740\u67e5\u8be2\u66f4\u5927\u7684L3\u7f13\u5b58\u3002L3\u901a\u5e38\u662f\u5171\u4eab\u7f13\u5b58&#xff0c;\u9762\u5411\u6574\u4e2a\u5904\u7406\u5668\u6838\u5fc3\u3002\u53ea\u6709\u5f53\u6240\u6709\u7f13\u5b58\u5c42\u7ea7\u90fd\u672a\u547d\u4e2d\u65f6&#xff0c;\u7cfb\u7edf\u624d\u4f1a\u8bbf\u95ee\u4e3b\u5b58&#xff0c;\u4ece\u7269\u7406\u5185\u5b58\u4e2d\u53d6\u56de\u76ee\u6807\u6570\u636e\u5757&#xff0c;\u5e76\u5728\u7f13\u5b58\u4e2d\u66f4\u65b0\u5bf9\u5e94\u5185\u5bb9\u3002<\/p>\n<h4 id=\"7.6%20hello%E8%BF%9B%E7%A8%8Bfork%E6%97%B6%E7%9A%84%E5%86%85%E5%AD%98%E6%98%A0%E5%B0%84\">7.6 hello\u8fdb\u7a0bfork\u65f6\u7684\u5185\u5b58\u6620\u5c04<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u4e00\u4e2a\u8fdb\u7a0b\u8c03\u7528fork()\u521b\u5efa\u5b50\u8fdb\u7a0b\u65f6&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u4e3a\u65b0\u8fdb\u7a0b\u5206\u914d\u4e00\u4e2a\u552f\u4e00\u7684\u8fdb\u7a0b\u6807\u8bc6\u7b26&#xff08;PID&#xff09;\u5e76\u521d\u59cb\u5316\u76f8\u5173\u7684\u5185\u6838\u6570\u636e\u7ed3\u6784\u3002\u63a5\u4e0b\u6765&#xff0c;\u865a\u62df\u5730\u5740\u7a7a\u95f4\u7684\u6620\u5c04\u6210\u4e3a\u5173\u952e\u6b65\u9aa4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u4e3a\u5b50\u8fdb\u7a0b\u521b\u5efa\u4e00\u4efd\u7236\u8fdb\u7a0b\u5185\u5b58\u6620\u5c04&#xff08;\u5373mm_struct&#xff09;\u3001\u865a\u62df\u5185\u5b58\u533a\u57df&#xff08;vma&#xff09;\u3001\u9875\u8868\u7b49\u7ed3\u6784\u7684\u526f\u672c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u6b64\u65f6\u8fd9\u4e9b\u526f\u672c\u53ea\u662f\u7ed3\u6784\u4e0a\u7684\u590d\u5236&#xff0c;\u5b83\u4eec\u4ecd\u7136\u6307\u5411\u76f8\u540c\u7684\u7269\u7406\u9875\u9762&#xff0c;\u5e76\u4e0d\u4f1a\u7acb\u523b\u590d\u5236\u5b9e\u9645\u7684\u5185\u5b58\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e3a\u4e86\u907f\u514d\u4e24\u4e2a\u8fdb\u7a0b\u76f4\u63a5\u5171\u4eab\u7269\u7406\u5185\u5b58\u5bfc\u81f4\u7684\u6570\u636e\u51b2\u7a81&#xff0c;\u7cfb\u7edf\u4f1a\u5c06\u5171\u4eab\u7684\u9875\u9762\u6807\u8bb0\u4e3a\u53ea\u8bfb&#xff0c;\u540c\u65f6\u5c06\u5176\u5185\u5b58\u533a\u57df\u8bbe\u7f6e\u4e3a\u79c1\u6709\u7684\u5199\u65f6\u590d\u5236\u7c7b\u578b\u3002\u8fd9\u6837&#xff0c;\u7236\u5b50\u8fdb\u7a0b\u53ef\u4ee5\u540c\u65f6\u8bfb\u53d6\u76f8\u540c\u7684\u7269\u7406\u9875\u9762\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e00\u65e6\u7236\u8fdb\u7a0b\u6216\u5b50\u8fdb\u7a0b\u5c1d\u8bd5\u5bf9\u67d0\u4e2a\u5171\u4eab\u9875\u9762\u6267\u884c\u5199\u64cd\u4f5c&#xff0c;\u5c31\u4f1a\u89e6\u53d1\u5199\u65f6\u590d\u5236\u673a\u5236&#xff1a;\u64cd\u4f5c\u7cfb\u7edf\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7269\u7406\u9875\u9762&#xff0c;\u5c06\u539f\u59cb\u9875\u9762\u5185\u5bb9\u590d\u5236\u5230\u65b0\u9875\u9762\u4e2d&#xff0c;\u7136\u540e\u5c06\u5199\u64cd\u4f5c\u91cd\u5b9a\u5411\u5230\u8be5\u65b0\u9875\u9762&#xff0c;\u5e76\u5c06\u5176\u6620\u5c04\u5230\u5199\u5165\u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4e2d\u3002\u8fd9\u6837&#xff0c;\u4e24\u4e2a\u8fdb\u7a0b\u5728\u903b\u8f91\u4e0a\u5c31\u62e5\u6709\u4e86\u72ec\u7acb\u7684\u5185\u5b58\u526f\u672c\u3002<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-100s54xyezs43.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 52 \u00a0\u4e24\u4e2a\u8fdb\u7a0b\u5bf9\u540c\u4e00\u5757\u7269\u7406\u5185\u5b58\u7684\u6620\u5c04<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u56e0\u6b64&#xff0c;fork()\u5728\u6267\u884c\u540e&#xff0c;\u5b50\u8fdb\u7a0b\u6700\u521d\u62e5\u6709\u4e0e\u7236\u8fdb\u7a0b\u76f8\u540c\u7684\u865a\u62df\u5185\u5b58\u5e03\u5c40\u548c\u5185\u5bb9&#xff0c;\u4f46\u5728\u968f\u540e\u7684\u5199\u5165\u8fc7\u7a0b\u4e2d&#xff0c;\u4f9d\u8d56COW\u4fdd\u8bc1\u5f7c\u6b64\u5185\u5b58\u7684\u9694\u79bb\u6027&#xff0c;\u4ece\u800c\u7ef4\u62a4\u4e86\u201c\u6bcf\u4e2a\u8fdb\u7a0b\u62e5\u6709\u72ec\u7acb\u865a\u62df\u5730\u5740\u7a7a\u95f4\u201d\u7684\u62bd\u8c61\u3002<\/p>\n<h4 id=\"7.7%20hello%E8%BF%9B%E7%A8%8Bexecve%E6%97%B6%E7%9A%84%E5%86%85%E5%AD%98%E6%98%A0%E5%B0%84\">7.7 hello\u8fdb\u7a0bexecve\u65f6\u7684\u5185\u5b58\u6620\u5c04<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5f53\u524d\u8fdb\u7a0b\u8c03\u7528execve(&#034;a.out&#034;,NULL,NULL)\u65f6&#xff0c;\u672c\u8d28\u4e0a\u662f\u8981\u6c42\u64cd\u4f5c\u7cfb\u7edf\u7528\u65b0\u7684\u7a0b\u5e8fa.out\u66ff\u6362\u5f53\u524d\u8fdb\u7a0b\u6b63\u5728\u6267\u884c\u7684\u7a0b\u5e8f&#xff0c;\u4f46\u8fdb\u7a0b\u672c\u8eab\u4e0d\u4f1a\u88ab\u9500\u6bc1&#xff08;\u5176PID\u4e0d\u53d8&#xff09;&#xff0c;\u53ea\u662f\u5b83\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u7ed3\u6784\u548c\u6267\u884c\u4e0a\u4e0b\u6587\u4f1a\u88ab\u91cd\u65b0\u5efa\u7acb\u3002\u6574\u4e2a\u8fc7\u7a0b\u5177\u4f53\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4&#xff1a;<\/p>\n<ul>\n<li style=\"text-align:justify\">\u6e05\u9664\u65e7\u7684\u7528\u6237\u7a7a\u95f4\u6620\u5c04&#xff1a;execve\u9996\u5148\u4f1a\u6e05\u9664\u5f53\u524d\u8fdb\u7a0b\u865a\u62df\u5730\u5740\u7a7a\u95f4\u4e2d\u7528\u6237\u7a7a\u95f4\u90e8\u5206\u7684\u6240\u6709\u6620\u5c04\u533a\u57df&#xff08;\u5373.text\u3001.data\u3001\u5806\u3001\u6808\u7b49&#xff09;&#xff0c;\u8fd9\u5305\u62ec\u5bf9\u5e94\u7684vm_area_struct\u548c\u9875\u8868\u9879\u3002\u8fd9\u6837\u505a\u7684\u76ee\u7684\u662f\u5f7b\u5e95\u79fb\u9664\u539f\u6709\u7a0b\u5e8f\u7684\u6240\u6709\u5185\u5b58\u75d5\u8ff9&#xff0c;\u4ee5\u4fbf\u4e3a\u52a0\u8f7d\u65b0\u7684\u7a0b\u5e8f\u505a\u51c6\u5907\u3002<\/li>\n<li style=\"text-align:justify\">\u5efa\u7acb\u65b0\u7684\u79c1\u6709\u6620\u5c04\u533a\u57df&#xff08;\u5199\u65f6\u590d\u5236&#xff09;&#xff1a;\u5bf9\u4e8e\u5373\u5c06\u6267\u884c\u7684\u7a0b\u5e8fa.out&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u91cd\u65b0\u521b\u5efa\u7528\u4e8e\u652f\u6301\u5176\u8fd0\u884c\u7684\u79c1\u6709\u5185\u5b58\u533a\u57df&#xff0c;\u5305\u62ec.text\u3001.data\u3001.bss\u533a\u57df\u3001\u5806\u548c\u6808\u3002\u6240\u6709\u8fd9\u4e9b\u533a\u57df\u90fd\u88ab\u8bbe\u7f6e\u4e3a\u79c1\u6709\u3001\u5199\u65f6\u590d\u5236\u7c7b\u578b&#xff0c;\u4ece\u800c\u4fdd\u8bc1\u540e\u7eed\u53ef\u80fd\u53d1\u751f\u7684\u5199\u64cd\u4f5c\u4e0d\u4f1a\u5f71\u54cd\u5e95\u5c42\u6587\u4ef6\u6216\u5176\u4ed6\u8fdb\u7a0b\u3002<\/li>\n<li style=\"text-align:justify\">\u52a0\u8f7d\u5171\u4eab\u5e93&#xff08;\u5171\u4eab\u6620\u5c04\u533a\u57df&#xff09;&#xff1a;\u5982\u679ca.out\u662f\u4e00\u4e2a\u4f7f\u7528\u4e86\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u4f8b\u5982\u94fe\u63a5\u4e86\u6807\u51c6C\u8fd0\u884c\u5e93libc.so&#xff0c;\u90a3\u4e48\u7cfb\u7edf\u4f1a\u5c06\u8fd9\u4e9b\u52a8\u6001\u5e93\u6587\u4ef6\u4f5c\u4e3a\u5171\u4eab\u6620\u5c04&#xff08;sharedmapping&#xff09;\u52a0\u8f7d\u5230\u8fdb\u7a0b\u7684\u865a\u62df\u5730\u5740\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10xkeiefvmqu3.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 53 \u00a0\u52a0\u8f7d\u5668\u5bf9\u7528\u6237\u5730\u5740\u7a7a\u95f4\u533a\u57df\u7684\u6620\u5c04<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bbe\u7f6e\u5165\u53e3\u70b9&#xff08;\u7a0b\u5e8f\u8ba1\u6570\u5668PC&#xff09;&#xff1a;\u5185\u6838\u6700\u540e\u4f1a\u66f4\u65b0\u5f53\u524d\u8fdb\u7a0b\u7684\u6267\u884c\u4e0a\u4e0b\u6587&#xff0c;\u5c06\u7a0b\u5e8f\u8ba1\u6570\u5668&#xff08;PC&#xff0c;\u6216\u79f0eip\/rip&#xff09;\u8bbe\u7f6e\u4e3aa.out\u7684\u5165\u53e3\u70b9&#xff08;\u7531ELF\u5934\u63d0\u4f9b&#xff09;&#xff0c;\u5e76\u51c6\u5907\u5728\u4e0b\u6b21\u88ab\u8c03\u5ea6\u8fd0\u884c\u65f6\u4ece\u8fd9\u4e2a\u5165\u53e3\u5730\u5740\u5f00\u59cb\u6267\u884c\u65b0\u7a0b\u5e8f\u3002<\/p>\n<h4 id=\"7.8%20%E7%BC%BA%E9%A1%B5%E6%95%85%E9%9A%9C%E4%B8%8E%E7%BC%BA%E9%A1%B5%E4%B8%AD%E6%96%AD%E5%A4%84%E7%90%86\">7.8 \u7f3a\u9875\u6545\u969c\u4e0e\u7f3a\u9875\u4e2d\u65ad\u5904\u7406<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">MMU\u5728\u8bd5\u56fe\u7ffb\u8bd1\u67d0\u4e2a\u865a\u62df\u5730\u5740A\u65f6&#xff0c;\u82e5\u89e6\u53d1\u4e86\u4e00\u4e2a\u7f3a\u9875&#xff0c;\u8fd9\u4e2a\u5f02\u5e38\u4f1a\u5bfc\u81f4\u63a7\u5236\u8f6c\u79fb\u5230\u5185\u6838\u7684\u7f3a\u9875\u5904\u7406\u7a0b\u5e8f&#xff0c;\u7f3a\u9875\u5904\u7406\u7a0b\u5e8f\u7684\u505a\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10yxr55dziygy.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 54 \u00a0\u7f3a\u9875\u5f02\u5e38\u884c\u4e3a<\/p>\n<ul>\n<li style=\"text-align:justify\">\u5408\u6cd5\u5730\u5740\u68c0\u67e5&#xff1a;\u5185\u6838\u9996\u5148\u5224\u65ad\u89e6\u53d1\u5f02\u5e38\u7684\u865a\u62df\u5730\u5740A\u662f\u5426\u5c5e\u4e8e\u8fdb\u7a0b\u5df2\u5206\u914d\u7684\u5730\u5740\u7a7a\u95f4\u533a\u57df&#xff0c;\u5373\u662f\u5426\u843d\u5728\u4efb\u4e00vm_area_struct\u63cf\u8ff0\u7684\u6709\u6548\u533a\u95f4\u5185\u3002\u8be5\u5224\u65ad\u901a\u8fc7\u904d\u5386\u6216\u641c\u7d22\u865a\u62df\u5185\u5b58\u533a\u57df\u7ed3\u6784\u5b8c\u6210\u3002\u82e5\u5730\u5740A\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u6709\u6548\u533a\u57df&#xff0c;\u8bf4\u660e\u8bbf\u95ee\u975e\u6cd5&#xff0c;\u5904\u7406\u7a0b\u5e8f\u5c06\u5f15\u53d1\u6bb5\u9519\u8bef&#xff08;segmentation\u00a0fault&#xff09;&#xff0c;\u7ec8\u6b62\u5f53\u524d\u8fdb\u7a0b\u3002\u4e3a\u63d0\u9ad8\u6548\u7387&#xff0c;Linux\u5b9e\u9645\u4e0a\u4f7f\u7528\u5e73\u8861\u6811\u7b49\u7ed3\u6784\u4f18\u5316\u4e86\u5bf9\u5185\u5b58\u533a\u57df\u7684\u67e5\u627e\u8fc7\u7a0b\u3002<\/li>\n<li style=\"text-align:justify\">\u8bbf\u95ee\u6743\u9650\u9a8c\u8bc1&#xff1a;\u82e5\u5730\u5740\u5408\u6cd5&#xff0c;\u5185\u6838\u7ee7\u7eed\u68c0\u67e5\u5f53\u524d\u8bbf\u95ee\u64cd\u4f5c\u662f\u5426\u7b26\u5408\u8be5\u533a\u57df\u8bbe\u5b9a\u7684\u8bbf\u95ee\u6743\u9650&#xff0c;\u4f8b\u5982\u662f\u5426\u8bd5\u56fe\u5199\u5165\u53ea\u8bfb\u6bb5\u3001\u6216\u5728\u7528\u6237\u6001\u8bbf\u95ee\u5185\u6838\u5730\u5740\u7a7a\u95f4\u3002\u82e5\u53d1\u73b0\u6743\u9650\u51b2\u7a81&#xff0c;\u5c06\u89e6\u53d1\u4fdd\u62a4\u5f02\u5e38&#xff08;protection\u00a0fault&#xff09;&#xff0c;\u540c\u6837\u5bfc\u81f4\u8fdb\u7a0b\u7ec8\u6b62\u3002<\/li>\n<li style=\"text-align:justify\">\u7f3a\u9875\u8c03\u5165\u4e0e\u9875\u8868\u66f4\u65b0&#xff1a;\u5f53\u5185\u6838\u786e\u8ba4\u5730\u5740\u4e0e\u6743\u9650\u5747\u5408\u6cd5\u65f6&#xff0c;\u4f1a\u6267\u884c\u7f3a\u9875\u7684\u5904\u7406\u903b\u8f91\u3002\u8fd9\u5305\u62ec\u9009\u62e9\u5e76\u56de\u6536\u4e00\u9875\u7269\u7406\u5185\u5b58&#xff08;\u82e5\u6709\u5fc5\u8981\u8fdb\u884c\u9875\u9762\u7f6e\u6362&#xff09;&#xff0c;\u5c06\u6240\u9700\u9875\u9762\u4ece\u78c1\u76d8\u6216\u533f\u540d\u533a\u57df\u52a0\u8f7d\u5230\u5185\u5b58&#xff0c;\u5e76\u66f4\u65b0\u9875\u8868\u4e2d\u7684\u6620\u5c04\u3002\u7f3a\u9875\u5904\u7406\u5b8c\u6210\u540e&#xff0c;\u5f02\u5e38\u8fd4\u56de&#xff0c;CPU\u4f1a\u91cd\u65b0\u6267\u884c\u539f\u59cb\u6307\u4ee4&#xff0c;\u6b64\u65f6MMU\u80fd\u591f\u6b63\u786e\u5b8c\u6210\u865a\u62df\u5730\u5740\u7684\u7ffb\u8bd1&#xff0c;\u4e0d\u518d\u5f15\u53d1\u5f02\u5e38\u3002<\/li>\n<\/ul>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"2025-06-10qw31ex0ox0d.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u56fe 55 \u00a0\u7f3a\u9875\u5f02\u5e38\u5904\u7406<\/p>\n<h4 id=\"7.10%20%E6%9C%AC%E7%AB%A0%E5%B0%8F%E7%BB%93\">7.9\u00a0\u672c\u7ae0\u5c0f\u7ed3<\/h4>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u672c\u7ae0\u7ec6\u81f4\u5730\u5206\u6790\u4e86hello\u8fdb\u7a0b\u7684\u5b58\u50a8\u5668\u5730\u5740\u7a7a\u95f4&#xff0c;\u5305\u62ec\u6bb5\u5f0f\u7ba1\u7406\u548c\u9875\u5f0f\u7ba1\u7406&#xff0c;\u9875\u5f0f\u7ba1\u7406\u53c8\u5305\u62ecTLB\u652f\u6301\u3001\u4e09\u7ea7cache\u8bbf\u95ee\u7269\u7406\u5185\u5b58\u3001\u591a\u7ea7\u9875\u8868\u3002\u5e76\u4e14\u8bb2\u89e3\u4e86hello\u8fdb\u7a0b\u4e2dfork\u548cexecve\u8fc7\u7a0b\u5185\u5b58\u6620\u5c04\u7684\u539f\u7406\u3002\u6700\u540e\u8ba8\u8bba\u4e86\u7f3a\u9875\u5f02\u5e38\u65f6\u673a\u5668\u7684\u5904\u7406\u65b9\u6cd5\u3002<\/p>\n<hr \/>\n<h3 id=\"%E7%BB%93%E8%AE%BA\" style=\"text-align:center\">\u7ed3\u8bba<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Hello\u6240\u7ecf\u5386\u7684\u8fc7\u7a0b&#xff1a;<\/p>\n<li style=\"text-align:justify\">hello.c\u6587\u4ef6\u7531\u7a0b\u5e8f\u5458\u8f93\u5165\u4ee3\u7801\u751f\u6210&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u9884\u5904\u7406&#xff08;hello.i&#xff09;&#xff1a;\u7531hello.c\u6587\u4ef6\u9884\u5904\u7406\u751f\u6210&#xff0c;\u5c06\u5934\u6587\u4ef6&#xff0c;\u5b8f\u66ff\u6362&#xff0c;\u6761\u4ef6\u7f16\u8bd1\u8bed\u53e5\u7b49\u8fdb\u884c\u66ff\u6362&#xff0c;\u53bb\u9664\u6ce8\u91ca&#xff0c;\u751f\u6210\u4e00\u4e2a\u5e72\u51c0\u7684\u6e90\u7a0b\u5e8f\u6587\u4ef6&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u7f16\u8bd1&#xff08;hello.s&#xff09;&#xff1a;\u7531hello.i\u6587\u4ef6\u7f16\u8bd1\u751f\u6210&#xff0c;\u5c06\u9ad8\u7ea7\u8bed\u8a00\u7a0b\u5e8f\u8f6c\u5316\u6210\u6c47\u7f16\u8bed\u8a00\u7a0b\u5e8f&#xff0c;\u4ee5\u4fbf\u4e8e\u540e\u7eed\u7684\u5904\u7406&#xff0c;\u540c\u65f6\u8fd8\u53ef\u80fd\u4f1a\u8fdb\u884c\u4e00\u4e9b\u7b80\u5355\u7684\u4f18\u5316&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u6c47\u7f16&#xff08;hello.o&#xff09;&#xff1a;\u7531hello.s\u6587\u4ef6\u6c47\u7f16\u751f\u6210&#xff0c;\u662f\u4e8c\u8fdb\u5236\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff0c;\u6587\u4ef6\u4e2d\u5bf9\u4e8e\u51fd\u6570\u8c03\u7528\u7684\u90e8\u5206\u4f1a\u4f59\u7559\u91cd\u5b9a\u4f4d\u6807\u5fd7&#xff0c;\u7b49\u5f85\u94fe\u63a5&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u94fe\u63a5&#xff08;hello&#xff09;&#xff1a;\u7531hello.o\u3001\u52a8\u6001\u94fe\u63a5\u5668\u3001\u52a8\u6001\u94fe\u63a5\u4f9d\u8d56\u5e93\u3001C\u7a0b\u5e8f\u542f\u52a8\u5e93\u7b49\u94fe\u63a5\u800c\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u901a\u8fc7shell\u76f4\u63a5\u8fd0\u884c&#xff1b;<\/li>\n<li style=\"text-align:justify\">fork\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff1a;\u63a5\u6536\u5230hello\u7a0b\u5e8f\u7684\u8fd0\u884c\u547d\u4ee4\u65f6&#xff0c;shell\u4f1a\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u5206\u7ed9hello&#xff0c;\u7528\u4e8ehello\u7684\u8fd0\u884c&#xff1b;<\/li>\n<li style=\"text-align:justify\">execve\u52a0\u8f7d\u7a0b\u5e8f&#xff1a;\u521b\u5efa\u5b50\u8fdb\u7a0b\u540e&#xff0c;\u52a0\u8f7dhello\u7684ELF\u5934\u76f8\u5173\u6570\u636e\u5230\u5185\u5b58&#xff0c;\u8fdb\u5165hello\u7684\u5165\u53e3\u70b9&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u6267\u884c\u6307\u4ee4&#xff1a;CPU\u4e3a\u8fdb\u7a0b\u5206\u914d\u65f6\u95f4\u7247&#xff0c;hello\u53ef\u4ee5\u4f7f\u7528CPU\u8d44\u6e90&#xff0c;\u987a\u5e8f\u6267\u884c\u81ea\u5df1\u7684\u673a\u5668\u6307\u4ee4\u6d41&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u8bbf\u95ee\u5185\u5b58&#xff1a;MU\u5c06\u7a0b\u5e8f\u4e2d\u7684\u865a\u62df\u5185\u5b58\u6620\u5c04\u5230\u7269\u7406\u5185\u5b58\u5730\u5740&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u4fe1\u53f7\u5904\u7406&#xff1a;\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5bf9\u5916\u754c\u8f93\u5165\u4f5c\u51fa\u53cd\u5e94&#xff0c;\u6bd4\u5982Ctrl-C\u3001Ctrl-Z\u7b49&#xff1b;<\/li>\n<li style=\"text-align:justify\">\u7ec8\u6b62&#xff1a;main\u51fd\u6570\u6267\u884c\u8fc7\u540e&#xff0c;\u7ecf\u8fc7\u975e\u5e38\u6f2b\u957f\u7684\u4e2d\u6b62\u51fd\u6570\u90e8\u5206&#xff0c;\u9000\u51fa\u7a0b\u5e8f&#xff0c;\u5185\u6838\u4f1a\u5c06hello\u6240\u6709\u6570\u636e\u7ed3\u6784\u4fe1\u606f\u5168\u90e8\u6e05\u9664&#xff0c;\u7236\u8fdb\u7a0b\u56de\u6536\u5b50\u8fdb\u7a0b\u3002<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5bf9\u8ba1\u7b97\u673a\u7cfb\u7edf\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u7684\u611f\u609f&#xff1a;\u770b\u4f3c\u5341\u5206\u7b80\u5355\u7684\u4e00\u4e2aC\u7a0b\u5e8f&#xff0c;\u5b9e\u9645\u7531\u8ba1\u7b97\u673a\u5b9e\u73b0\u8d77\u6765\u5374\u8981\u590d\u6742\u65e0\u6570\u500d&#xff0c;\u611f\u53d7\u6df1\u5207&#xff0c;\u6545\u5bf9\u8ba1\u7b97\u673a\u53d1\u5c55\u5386\u53f2\u4e0a&#xff0c;\u65e0\u6570\u63a8\u52a8\u8ba1\u7b97\u673a\u4e00\u70b9\u70b9\u53d1\u5c55\u5230\u4eca\u5929\u7684\u6c34\u5e73\u7684\u8ba1\u7b97\u673a\u5b66\u524d\u8f88\u4eec\u8868\u793a\u5d07\u656c\u3002\u5bf9\u4e8e\u8ba1\u7b97\u673a\u7cfb\u7edf\u7684\u4e13\u4e1a\u77e5\u8bc6\u4e0a&#xff0c;\u6682\u65f6\u5e76\u6ca1\u6709\u521b\u65b0\u7406\u5ff5&#xff0c;\u4e0d\u8fc7\u5927\u4f5c\u4e1a\u8ba9\u6211\u611f\u53d7\u5230&#xff0c;\u65e2\u7136\u4e00\u4e2a\u7a0b\u5e8f\u7684\u6267\u884c\u9700\u8981\u5982\u6b64\u591a\u7684\u8fc7\u7a0b&#xff0c;\u90a3\u4e48\u4e5f\u51b3\u5b9a\u4e86\u8ba1\u7b97\u673a\u7684\u53d1\u5c55\u4ecd\u7136\u6ca1\u6709\u8fbe\u5230\u4e0a\u9650&#xff0c;\u4f9d\u7136\u6709\u65e0\u9650\u7684\u6f5c\u529b&#xff0c;\u672a\u6765\u5e94\u5f53\u5728\u8fd9\u534a\u4e2a\u5b66\u671f\u5e76\u6ca1\u600e\u4e48\u5b66\u900f\u7684\u8ba1\u7b97\u673a\u7cfb\u7edf\u5b66\u79d1\u4e0a\u7ee7\u7eed\u6df1\u8015&#xff0c;\u56e0\u4e3a\u5f80\u5f80\u66f4\u9ad8\u7684\u4e0a\u9650\u6765\u6e90\u4e8e\u5e95\u5c42\u7684\u521b\u65b0\u3002\u6700\u540e&#xff0c;\u7cbe\u5de7\u4e25\u8c28\u7684\u673a\u5668\u6c47\u7f16\u8bed\u8a00\u4e5f\u8ba9\u6211\u89e6\u6478\u5230\u4e86\u201c\u7528\u8ba1\u7b97\u673a\u7684\u601d\u7ef4\u201d\u53bb\u7814\u7a76\u7a0b\u5e8f&#xff0c;\u7814\u7a76\u8ba1\u7b97\u673a\u7684\u610f\u8bc6\u3002<\/p>\n<hr \/>\n<h3 id=\"%E9%99%84%E4%BB%B6\" style=\"margin-left:0.0001pt;margin-right:0px;text-align:center\">\u9644\u4ef6<\/h3>\n<table border=\"1\" style=\"margin-left:2.6500pt\">\n<tbody>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4e2d\u95f4\u9644\u4ef6\u540d\u79f0<\/p>\n<\/td>\n<td style=\"height:36.9500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4f5c\u7528<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello<\/p>\n<\/td>\n<td style=\"height:36.9500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;hello.o\u4e0e\u52a8\u6001\u5e93\u3001\u542f\u52a8\u5e93\u7b49\u94fe\u63a5\u5f97\u5230&#xff0c;\u673a\u5668\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.i<\/p>\n<\/td>\n<td style=\"height:36.9500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u9884\u5904\u7406\u6587\u4ef6&#xff0c;\u5934\u6587\u4ef6\u5c55\u5f00\u3001\u5b8f\u66ff\u6362\u7b49<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.s<\/p>\n<\/td>\n<td style=\"height:36.9500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u6c47\u7f16\u8bed\u8a00\u6587\u4ef6&#xff0c;\u9762\u5bf9\u673a\u5668\u67b6\u6784\u7684\u5355\u6b65\u63a7\u5236\u7a0b\u5e8f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:58.2500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.o<\/p>\n<\/td>\n<td style=\"height:58.2500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\u4e8c\u8fdb\u5236\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6&#xff0c;\u673a\u5668\u80fd\u8bfb\u61c2\u7684\u673a\u5668\u6307\u4ee4&#xff08;16\u8fdb\u5236&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.elf<\/p>\n<\/td>\n<td style=\"height:36.9500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.o\u7684ELF\u683c\u5f0f\u6587\u4ef6&#xff0c;\u7528\u4e8e\u5206\u6790hello.o\u7684\u5185\u5bb9<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.arm<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"2\" style=\"height:36.9500pt;vertical-align:center;width:296.1500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello.o\u4e0ehello\u53cd\u6c47\u7f16\u6587\u4ef6&#xff0c;\u7528\u4e8e\u5bf9\u6bd4\u5b66\u4e60hello.o\u4e2d\u673a\u5668\u6307\u4ee4\u4e0ehello\u4e2d\u7684\u5dee\u5f02&#xff0c;\u611f\u53d7\u91cd\u5b9a\u4f4d\u3001\u52a8\u6001\u94fe\u63a5\u7b49\u8fc7\u7a0b\u7684\u884c\u4e3a<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:36.9500pt;vertical-align:center;width:53.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">hello1.arm<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3 id=\"%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE\" style=\"text-align:center\">\u53c2\u8003\u6587\u732e<\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[1] \u00a0Randal E.Bryant David R.O&#039;Hallaron.\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf&#xff08;\u7b2c\u4e09\u7248&#xff09;.\u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e&#xff0c;2016.<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[2] \u00a0https:\/\/www.cnblogs.com\/theseventhson\/p\/15668338.html<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[3] \u00a0https:\/\/zhuanlan.zhihu.com\/p\/466602063<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">[4]\u00a0\u00a0https:\/\/www.cnblogs.com\/sky-heaven\/p\/15891042.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.6k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u672c\u6587\u8ddf\u968fhello.c\u7a0b\u5e8f\uff0c\u8d70\u8fc7\u4e86\u5b83\u4ece\u8bde\u751f\u5230\u88ab\u8fd0\u884c\u5230\u7ec8\u6b62\u7684\u6574\u4e2a\u201c\u4eba\u751f\u201d\u3002\u8fd9\u201c\u4e00\u751f\u201d\u5305\u62echello.c\u7a0b\u5e8f\u7684\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5\u3001shell\u547d\u4ee4\u884c\u8f93\u5165\u3001fork\u3001execve\u3001\u8fd0\u884c\u76f4\u5230\u7ec8\u6b62\u3002\u4f7f\u7528gcc\u3001gdb\u3001edb\u3001objdump\u3001readelf\u7b49\u5f00\u53d1\u8c03\u8bd5\u5de5\u5177\uff0c\u53bb\u89e3\u8bfb\u4e86hello\u7a0b\u5e8f\u7684\u201c\u4e00\u4e16\u6d6e\u6c89\u201d\u3002\u4ecehello\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u4e2d\uff0c\u6211\u4eec\u4f1a\u6536\u83b7\u5b83\u4e0d\u65ad\u6f14\u53d8\u7684\u89c4\u5219\uff0c\u5206\u6790\u8ba1\u7b97\u673a\u4e00\u6b65\u4e00\u6b65\u5904\u7406hello.c\u6e90\u6587\u4ef6\u7684\u539f\u7406\u3002\u6700\u540e\uff0c\u6211\u4eec\u6f14\u793a\u4e86\u5176\u4e2d\u4e00\u4e9b\u73af\u8282\u7684\u64cd\u4f5c\u548c\u7ed3\u679c\uff0c\u6765\u501f\u52a9hello\u953b\u70bc\u6211\u4eec\u7684\u8ba1\u7b97\u673a\u7cfb\u7edf\u601d\u7ef4\uff01<\/p>\n","protected":false},"author":2,"featured_media":42798,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,3982,1468,3983,1917,125,3011],"topic":[],"class_list":["post-42818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-hello","tag-shell","tag-3983","tag-1917","tag-125","tag-3011"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \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\/42818.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.6k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u672c\u6587\u8ddf\u968fhello.c\u7a0b\u5e8f\uff0c\u8d70\u8fc7\u4e86\u5b83\u4ece\u8bde\u751f\u5230\u88ab\u8fd0\u884c\u5230\u7ec8\u6b62\u7684\u6574\u4e2a\u201c\u4eba\u751f\u201d\u3002\u8fd9\u201c\u4e00\u751f\u201d\u5305\u62echello.c\u7a0b\u5e8f\u7684\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5\u3001shell\u547d\u4ee4\u884c\u8f93\u5165\u3001fork\u3001execve\u3001\u8fd0\u884c\u76f4\u5230\u7ec8\u6b62\u3002\u4f7f\u7528gcc\u3001gdb\u3001edb\u3001objdump\u3001readelf\u7b49\u5f00\u53d1\u8c03\u8bd5\u5de5\u5177\uff0c\u53bb\u89e3\u8bfb\u4e86hello\u7a0b\u5e8f\u7684\u201c\u4e00\u4e16\u6d6e\u6c89\u201d\u3002\u4ecehello\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u4e2d\uff0c\u6211\u4eec\u4f1a\u6536\u83b7\u5b83\u4e0d\u65ad\u6f14\u53d8\u7684\u89c4\u5219\uff0c\u5206\u6790\u8ba1\u7b97\u673a\u4e00\u6b65\u4e00\u6b65\u5904\u7406hello.c\u6e90\u6587\u4ef6\u7684\u539f\u7406\u3002\u6700\u540e\uff0c\u6211\u4eec\u6f14\u793a\u4e86\u5176\u4e2d\u4e00\u4e9b\u73af\u8282\u7684\u64cd\u4f5c\u548c\u7ed3\u679c\uff0c\u6765\u501f\u52a9hello\u953b\u70bc\u6211\u4eec\u7684\u8ba1\u7b97\u673a\u7cfb\u7edf\u601d\u7ef4\uff01\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/42818.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-10T00:56:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd07be4.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=\"14 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42818.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/42818.html\",\"name\":\"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-10T00:56:32+00:00\",\"dateModified\":\"2025-06-10T00:56:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/42818.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/42818.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42818.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P\"}]},{\"@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":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \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\/42818.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.6k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u672c\u6587\u8ddf\u968fhello.c\u7a0b\u5e8f\uff0c\u8d70\u8fc7\u4e86\u5b83\u4ece\u8bde\u751f\u5230\u88ab\u8fd0\u884c\u5230\u7ec8\u6b62\u7684\u6574\u4e2a\u201c\u4eba\u751f\u201d\u3002\u8fd9\u201c\u4e00\u751f\u201d\u5305\u62echello.c\u7a0b\u5e8f\u7684\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5\u3001shell\u547d\u4ee4\u884c\u8f93\u5165\u3001fork\u3001execve\u3001\u8fd0\u884c\u76f4\u5230\u7ec8\u6b62\u3002\u4f7f\u7528gcc\u3001gdb\u3001edb\u3001objdump\u3001readelf\u7b49\u5f00\u53d1\u8c03\u8bd5\u5de5\u5177\uff0c\u53bb\u89e3\u8bfb\u4e86hello\u7a0b\u5e8f\u7684\u201c\u4e00\u4e16\u6d6e\u6c89\u201d\u3002\u4ecehello\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u4e2d\uff0c\u6211\u4eec\u4f1a\u6536\u83b7\u5b83\u4e0d\u65ad\u6f14\u53d8\u7684\u89c4\u5219\uff0c\u5206\u6790\u8ba1\u7b97\u673a\u4e00\u6b65\u4e00\u6b65\u5904\u7406hello.c\u6e90\u6587\u4ef6\u7684\u539f\u7406\u3002\u6700\u540e\uff0c\u6211\u4eec\u6f14\u793a\u4e86\u5176\u4e2d\u4e00\u4e9b\u73af\u8282\u7684\u64cd\u4f5c\u548c\u7ed3\u679c\uff0c\u6765\u501f\u52a9hello\u953b\u70bc\u6211\u4eec\u7684\u8ba1\u7b97\u673a\u7cfb\u7edf\u601d\u7ef4\uff01","og_url":"https:\/\/www.wsisp.com\/helps\/42818.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-10T00:56:32+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250610005629-684782bd07be4.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"14 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/42818.html","url":"https:\/\/www.wsisp.com\/helps\/42818.html","name":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-10T00:56:32+00:00","dateModified":"2025-06-10T00:56:32+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/42818.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/42818.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/42818.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7a0b\u5e8f\u4eba\u751f-Hello\u2019s P2P"}]},{"@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\/42818","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=42818"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42818\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/42798"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=42818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=42818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=42818"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=42818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}