{"id":103500,"date":"2026-09-10T19:17:31","date_gmt":"2026-09-10T11:17:31","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/103500.html"},"modified":"2026-09-10T19:17:31","modified_gmt":"2026-09-10T11:17:31","slug":"%e7%ac%ac%e5%8d%81%e5%85%ab%e8%ae%b2%ef%bc%9alinux%e4%b8%8b%e7%a8%8b%e5%ba%8f%e6%89%a7%e8%a1%8c%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/103500.html","title":{"rendered":"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b"},"content":{"rendered":"<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"255\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111729-6aa291c922580.png\" width=\"500\" \/><\/p>\n<p>\u5927\u5bb6\u597d&#xff0c;\u63a5\u4e0b\u6765\u7684\u4e00\u6bb5\u65f6\u95f4\u6211\u5c06\u5f00\u59cb\u5b66\u4e60\u91ce\u706b\u7684Linux\u7cfb\u7edf\u8bfe\u7a0b\u5e76\u5c06\u5b66\u4e60\u5230\u7684\u5e72\u8d27\u9010\u6b65\u66f4\u65b0\u5230\u6211\u7684CSDN\u535a\u5ba2\u4e2d\u3002\u6ca1\u65f6\u95f4\u5237\u8bfe\u7684\u540c\u5b66\u53ef\u4ee5\u628a\u6211\u7684\u535a\u5ba2\u5582\u7ed9AI \u7a81\u51fb\u4e00\u4e0b\u3002<\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%89%E4%B8%AA%E9%97%AE%E9%A2%98-toc\" style=\"margin-left:0px\">\u4e09\u4e2a\u95ee\u9898<\/p>\n<p id=\"1%E3%80%81%E4%BA%86%E8%A7%A3%20Hello%20World%20%E7%A8%8B%E5%BA%8F%E7%9A%84%E6%89%A7%E8%A1%8C%E8%BF%87%E7%A8%8B%E6%9C%89%E4%BB%80%E4%B9%88%E7%94%A8%EF%BC%9F-toc\" style=\"margin-left:40px\">1\u3001\u4e86\u89e3 Hello World \u7a0b\u5e8f\u7684\u6267\u884c\u8fc7\u7a0b\u6709\u4ec0\u4e48\u7528&#xff1f;<\/p>\n<p id=\"2%E3%80%81%E8%A3%B8%E6%9C%BA%E5%BC%80%E5%8F%91%E4%B8%AD%E7%9A%84%20HelloWorld%20%E7%A8%8B%E5%BA%8F%E6%98%AF%E6%80%8E%E4%B9%88%E6%89%A7%E8%A1%8C%E7%9A%84%EF%BC%9F-toc\" style=\"margin-left:40px\">2\u3001\u88f8\u673a\u5f00\u53d1\u4e2d\u7684 HelloWorld \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f;<\/p>\n<p id=\"3%E3%80%81Linux%20%E7%B3%BB%E7%BB%9F%E4%B8%8B%E7%9A%84%20Hello%20World%20%E7%A8%8B%E5%BA%8F%E6%98%AF%E6%80%8E%E4%B9%88%E6%89%A7%E8%A1%8C%E7%9A%84%EF%BC%9F-toc\" style=\"margin-left:40px\">3\u3001Linux \u7cfb\u7edf\u4e0b\u7684 Hello World \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f;<\/p>\n<p id=\"%E9%98%B6%E6%AE%B5%E4%B8%80%EF%BC%9AGCC%20%E7%BC%96%E8%AF%91%E5%9B%9B%E6%AD%A5-toc\" style=\"margin-left:120px\">\u9636\u6bb5\u4e00&#xff1a;GCC \u7f16\u8bd1\u56db\u6b65<\/p>\n<p id=\"%E9%98%B6%E6%AE%B5%E4%BA%8C%EF%BC%9A%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E5%AE%8C%E6%95%B4%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:120px\">\u9636\u6bb5\u4e8c&#xff1a;\u7a0b\u5e8f\u8fd0\u884c\u5b8c\u6574\u6d41\u7a0b<\/p>\n<p id=\"%E5%9B%9B%E4%B8%AA%E6%A1%88%E4%BE%8B-toc\" style=\"margin-left:0px\">\u56db\u4e2a\u6848\u4f8b<\/p>\n<p id=\"gcc%20%E9%A2%84%E5%A4%84%E7%90%86%20c%20%E6%96%87%E4%BB%B6-toc\" style=\"margin-left:40px\">gcc \u9884\u5904\u7406 c \u6587\u4ef6<\/p>\n<p id=\"gcc%20%E7%BC%96%E8%AF%91%20c%20%E6%96%87%E4%BB%B6%EF%BC%88%E7%94%9F%E6%88%90%E6%B1%87%E7%BC%96%EF%BC%89-toc\" style=\"margin-left:40px\">gcc \u7f16\u8bd1 c \u6587\u4ef6&#xff08;\u751f\u6210\u6c47\u7f16&#xff09;<\/p>\n<p id=\"gcc%20%E7%BC%96%E8%AF%91%E6%B1%87%E7%BC%96%EF%BC%88%E7%94%9F%E6%88%90%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6%EF%BC%89-toc\" style=\"margin-left:40px\">gcc \u7f16\u8bd1\u6c47\u7f16&#xff08;\u751f\u6210\u76ee\u6807\u6587\u4ef6&#xff09;<\/p>\n<p id=\"gcc%20%E9%93%BE%E6%8E%A5%E5%8F%AF%E9%87%8D%E5%AE%9A%E4%BD%8D%E6%96%87%E4%BB%B6-toc\" style=\"margin-left:40px\">gcc \u94fe\u63a5\u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6<\/p>\n<hr id=\"hr-toc\" \/>\n<p>Linux\u7cfb\u7edf\u4e0b\u7684Hello World\u7684\u501f\u9274\u610f\u4e49\u975e\u5e38\u5f3a&#xff0c; \u5bf9\u6211\u4eec\u4ee5\u540e\u8fdb\u4e00\u6b65\u5b66\u4e60\u5176\u4ed6\u8bfe\u7a0b\u8d77\u5230\u5f88\u597d\u7684\u6307\u5bfc\u4f5c\u7528&#xff0c;\u9762\u8bd5\u7684\u65f6\u5019\u9762\u8bd5\u5b98\u4e5f\u5f88\u7231\u95ee\u8fd9\u90e8\u5206\u77e5\u8bc6\u6765\u8003\u9a8c\u9762\u8bd5\u8005\u77e5\u8bc6\u624e\u5b9e\u7a0b\u5ea6&#xff0c;\u5927\u5bb6\u5c3d\u91cf\u628a\u8fd9\u5757\u201c\u786c\u9aa8\u5934\u201d\u5543\u4e0b\u6765\u3002<\/p>\n<p><span class=\"link-card-box\"><span class=\"link-title\">5. Linux\u7cfb\u7edf\u4e0b\u7684Hello World \u2014 [\u91ce\u706b]\u5d4c\u5165\u5f0fLinux\u57fa\u7840\u4e0e\u5e94\u7528\u5f00\u53d1\u5b9e\u6218\u6307\u5357\u2014\u2014\u57fa\u4e8ei.MX6ULL\u5f00\u53d1\u677f \u6587\u6863<\/span><span class=\"link-link\"><img decoding=\"async\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111730-6aa291ca73134.png\" \/>https:\/\/doc.embedfire.com\/linux\/imx6\/linux_base\/zh\/latest\/linux_app\/hello_in_linux\/hello_in_linux.html<\/span><\/span><\/p>\n<h2 id=\"%E4%B8%89%E4%B8%AA%E9%97%AE%E9%A2%98\">\u4e09\u4e2a\u95ee\u9898<\/h2>\n<h3 id=\"1%E3%80%81%E4%BA%86%E8%A7%A3%20Hello%20World%20%E7%A8%8B%E5%BA%8F%E7%9A%84%E6%89%A7%E8%A1%8C%E8%BF%87%E7%A8%8B%E6%9C%89%E4%BB%80%E4%B9%88%E7%94%A8%EF%BC%9F\">1\u3001\u4e86\u89e3 Hello World \u7a0b\u5e8f\u7684\u6267\u884c\u8fc7\u7a0b\u6709\u4ec0\u4e48\u7528&#xff1f;<\/h3>\n<li>\u5bf9\u5f00\u53d1\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f&#xff0c;\u6709\u975e\u5e38\u597d\u7684\u501f\u9274\u610f\u4e49\u3002<\/li>\n<li>\u5bf9\u7a0b\u5e8f\u7684\u62a5\u9519\u6709\u6e05\u6670\u7684\u4e86\u89e3&#xff0c;\u4ece\u800c\u9488\u5bf9\u6027\u5730\u89e3\u51b3\u95ee\u9898\u3002<\/li>\n<h3 id=\"2%E3%80%81%E8%A3%B8%E6%9C%BA%E5%BC%80%E5%8F%91%E4%B8%AD%E7%9A%84%20HelloWorld%20%E7%A8%8B%E5%BA%8F%E6%98%AF%E6%80%8E%E4%B9%88%E6%89%A7%E8%A1%8C%E7%9A%84%EF%BC%9F\">2\u3001\u88f8\u673a\u5f00\u53d1\u4e2d\u7684 HelloWorld \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f;<\/h3>\n<p>\u88f8\u673a&#xff1a;\u65e0\u64cd\u4f5c\u7cfb\u7edf&#xff0c;CPU \u4e0a\u7535\u76f4\u63a5\u8df3\u8f6c\u5230\u7a0b\u5e8f\u5165\u53e3\u3002<\/p>\n<p>\u4e0a\u7535\u2192CPU \u590d\u4f4d&#xff0c;\u6267\u884c\u590d\u4f4d\u5411\u91cf\u5165\u53e3\u51fd\u6570\u2192\u521d\u59cb\u5316\u6808\u3001bss \u6bb5\u2192\u624b\u52a8\u8c03\u7528 main \u51fd\u6570\u2192\u6267\u884c\u6253\u5370&#xff08;\u64cd\u4f5c\u5bc4\u5b58\u5668\u9a71\u52a8\u4e32\u53e3&#xff09;\u2192\u7a0b\u5e8f\u5faa\u73af \/ \u9000\u51fa\u3002<\/p>\n<h3 id=\"3%E3%80%81Linux%20%E7%B3%BB%E7%BB%9F%E4%B8%8B%E7%9A%84%20Hello%20World%20%E7%A8%8B%E5%BA%8F%E6%98%AF%E6%80%8E%E4%B9%88%E6%89%A7%E8%A1%8C%E7%9A%84%EF%BC%9F\">3\u3001Linux \u7cfb\u7edf\u4e0b\u7684 Hello World \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f;<\/h3>\n<p>\u5b8c\u6574\u94fe\u8def\u5206\u4e3a\u4e24\u5927\u9636\u6bb5&#xff1a;GCC \u7f16\u8bd1\u9636\u6bb5 &#043; \u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5&#xff08;Shell\u2011\u5185\u6838\u2011glibc\u2011\u5e94\u7528&#xff09;<\/p>\n<h5 id=\"%E9%98%B6%E6%AE%B5%E4%B8%80%EF%BC%9AGCC%20%E7%BC%96%E8%AF%91%E5%9B%9B%E6%AD%A5\">\u9636\u6bb5\u4e00&#xff1a;GCC \u7f16\u8bd1\u56db\u6b65<\/h5>\n<table>\n<tr>\u5e8f\u53f7\u6b65\u9aa4\u547d\u4ee4\u8f93\u5165\u8f93\u51fa\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u2460<\/td>\n<td>\u9884\u5904\u7406<\/td>\n<td>gcc -E hello.c -o hello.i<\/td>\n<td>hello.c<\/td>\n<td>hello.i<\/td>\n<td>\u5c55\u5f00\u5934\u6587\u4ef6\u3001\u5b8f\u66ff\u6362&#xff0c;\u53bb\u6389\u6ce8\u91ca<\/td>\n<\/tr>\n<tr>\n<td>\u2461<\/td>\n<td>\u7f16\u8bd1<\/td>\n<td>gcc -S hello.i -o hello.s<\/td>\n<td>hello.i<\/td>\n<td>hello.s<\/td>\n<td>C \u8bed\u8a00\u2192\u6c47\u7f16\u4ee3\u7801<\/td>\n<\/tr>\n<tr>\n<td>\u2462<\/td>\n<td>\u6c47\u7f16<\/td>\n<td>gcc -c hello.s -o hello.o<\/td>\n<td>hello.s<\/td>\n<td>hello.o<\/td>\n<td>\u6c47\u7f16\u2192\u673a\u5668\u7801&#xff0c;\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u2463<\/td>\n<td>\u94fe\u63a5<\/td>\n<td>gcc hello.o -o hello<\/td>\n<td>hello.o<\/td>\n<td>hello&#xff08;ELF \u53ef\u6267\u884c\u7a0b\u5e8f&#xff09;<\/td>\n<td>\u5408\u5e76\u6bb5&#xff0c;\u94fe\u63a5\u7cfb\u7edf\u5e93&#xff0c;\u751f\u6210\u6700\u7ec8\u53ef\u6267\u884c\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7f16\u8bd1\u5b8c\u6210\u5f97\u5230 ELF \u683c\u5f0f hello&#xff0c;Shell \u8f93\u5165 .\/hello \u5f00\u59cb\u8fd0\u884c\u3002<\/p>\n<h5 id=\"%E9%98%B6%E6%AE%B5%E4%BA%8C%EF%BC%9A%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E5%AE%8C%E6%95%B4%E6%B5%81%E7%A8%8B\">\u9636\u6bb5\u4e8c&#xff1a;\u7a0b\u5e8f\u8fd0\u884c\u5b8c\u6574\u6d41\u7a0b<\/h5>\n<p>\u2464 Shell \u6536\u5230.\/hello\u547d\u4ee4 \u2465 Shell \u8c03\u7528fork()\u7cfb\u7edf\u8c03\u7528&#xff0c;\u521b\u5efa\u5b50\u8fdb\u7a0b \u2466 \u5b50\u8fdb\u7a0b\u8c03\u7528execve()\u7528\u6237\u6001\u5e93\u51fd\u6570 \u2467 \u9677\u5165\u5185\u6838&#xff0c;\u6267\u884c\u7cfb\u7edf\u8c03\u7528\u5165\u53e3sys_execve() \u2468 \u5185\u6838\u5185\u90e8\u8c03\u7528do_execve()&#xff0c;\u89e3\u6790 ELF \u6587\u4ef6 \u2469 load_elf_binary()&#xff1a;\u5185\u6838\u52a0\u8f7d ELF \u7a0b\u5e8f\u5230\u8fdb\u7a0b\u865a\u62df\u5730\u5740\u7a7a\u95f4&#xff1b;\u52a0\u8f7d\u52a8\u6001\u94fe\u63a5\u5668ld\u2011linux\u2011xx.so \u246a \u628a CPU \u63a7\u5236\u6743\u4ea4\u7ed9\u52a8\u6001\u94fe\u63a5\u5668 \u246b \u52a8\u6001\u94fe\u63a5\u5668\u5b8c\u6210\u5e93\u91cd\u5b9a\u4f4d&#xff0c;\u8c03\u7528_start&#xff1b;_start\u8c03\u7528 glibc \u5165\u53e3_libc_start_main() \u246c _libc_start_main()\u505a\u521d\u59cb\u5316&#xff0c;\u8c03\u7528\u6211\u4eec\u5199\u7684 main () \u51fd\u6570 \u246d main \u5185\u90e8\u6267\u884cprintf(&#034;hello,world!\\\\r\\\\n&#034;)&#xff1b;main \u8fd4\u56de\u540e glibc \u8c03\u7528_exit()\u7cfb\u7edf\u8c03\u7528&#xff0c;\u901a\u77e5\u5185\u6838\u9500\u6bc1\u8fdb\u7a0b&#xff0c;\u7a0b\u5e8f\u7ed3\u675f\u3002<\/p>\n<p>\u5173\u952e\u70b9&#xff1a;main \u4e0d\u662f\u7a0b\u5e8f\u7684\u771f\u6b63\u5165\u53e3&#xff0c;\u771f\u6b63\u5165\u53e3\u662f_start&#xff0c;main \u53ea\u662f\u5e93\u51fd\u6570\u8c03\u7528\u7684\u4e00\u4e2a\u666e\u901a\u51fd\u6570\u3002<\/p>\n<h2 id=\"%E5%9B%9B%E4%B8%AA%E6%A1%88%E4%BE%8B\">\u56db\u4e2a\u6848\u4f8b<\/h2>\n<h3 id=\"gcc%20%E9%A2%84%E5%A4%84%E7%90%86%20c%20%E6%96%87%E4%BB%B6\">gcc \u9884\u5904\u7406 c \u6587\u4ef6<\/h3>\n<p>gcc -E hello.c -o hello.i    #\u672b\u5c3e\u52a0\u4e0a-v\u628a\u4fe1\u606f\u5168\u90e8\u6253\u5370\u51fa\u6765<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"75\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111730-6aa291ca7c4df.png\" width=\"712\" \/><\/p>\n<table>\n<tr>\u7247\u6bb5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>cc1<\/td>\n<td>GCC \u7684 C \u8bed\u8a00\u7f16\u8bd1\u5668\u524d\u7aef&#xff08;\u771f\u6b63\u5e72\u6d3b\u7684\u7a0b\u5e8f&#xff0c;gcc \u547d\u4ee4\u53ea\u662f\u4e2a\u8c03\u5ea6\u5668&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-E<\/td>\n<td>\u53ea\u505a\u9884\u5904\u7406&#xff0c;\u4e0d\u7f16\u8bd1<\/td>\n<\/tr>\n<tr>\n<td>hello.c<\/td>\n<td>\u8f93\u5165\u6e90\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-o hello.i<\/td>\n<td>\u8f93\u51fa\u9884\u5904\u7406\u540e\u7684 .i \u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-fstack-protector-strong<\/td>\n<td>\u6808\u4fdd\u62a4&#xff08;\u9632\u6ea2\u51fa\u653b\u51fb&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-Wformat -Wformat-security<\/td>\n<td>\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u5b89\u5168\u8b66\u544a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"gcc%20%E7%BC%96%E8%AF%91%20c%20%E6%96%87%E4%BB%B6%EF%BC%88%E7%94%9F%E6%88%90%E6%B1%87%E7%BC%96%EF%BC%89\">gcc \u7f16\u8bd1 c \u6587\u4ef6&#xff08;\u751f\u6210\u6c47\u7f16&#xff09;<\/h3>\n<p>gcc -S hello.i -o hello.s    #\u672b\u5c3e\u52a0\u4e0a-v\u628a\u4fe1\u606f\u5168\u90e8\u6253\u5370\u51fa\u6765<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"74\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111730-6aa291ca8c641.png\" width=\"709\" \/><\/p>\n<table>\n<tr>\u7247\u6bb5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>cc1<\/td>\n<td>\u540c\u4e00\u4e2a\u7f16\u8bd1\u5668\u524d\u7aef&#xff0c;\u8fd9\u6b21\u4e0d\u5e26 -E<\/td>\n<\/tr>\n<tr>\n<td>-fpreprocessed<\/td>\n<td>\u544a\u8bc9 cc1 \u8f93\u5165\u5df2\u7ecf\u662f\u9884\u5904\u7406\u8fc7\u7684\u6587\u4ef6&#xff0c;\u4e0d\u7528\u518d\u5904\u7406\u5b8f\u4e86<\/td>\n<\/tr>\n<tr>\n<td>hello.i<\/td>\n<td>\u8f93\u5165&#xff1a;\u9884\u5904\u7406\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-o hello.s<\/td>\n<td>\u8f93\u51fa&#xff1a;\u6c47\u7f16\u4ee3\u7801 .s \u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"gcc%20%E7%BC%96%E8%AF%91%E6%B1%87%E7%BC%96%EF%BC%88%E7%94%9F%E6%88%90%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6%EF%BC%89\">gcc \u7f16\u8bd1\u6c47\u7f16&#xff08;\u751f\u6210\u76ee\u6807\u6587\u4ef6&#xff09;<\/h3>\n<p>gcc -c hello.s -o hello.o    #\u672b\u5c3e\u52a0\u4e0a-v\u628a\u4fe1\u606f\u5168\u90e8\u6253\u5370\u51fa\u6765<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"37\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111730-6aa291ca9c7e8.png\" width=\"705\" \/><\/p>\n<table>\n<tr>\u7247\u6bb5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>as<\/td>\n<td>binutils \u91cc\u7684\u6c47\u7f16\u5668&#xff0c;\u4e0d\u5c5e\u4e8e gcc \u672c\u4f53<\/td>\n<\/tr>\n<tr>\n<td>-64<\/td>\n<td>\u751f\u6210 64 \u4f4d\u76ee\u6807\u4ee3\u7801<\/td>\n<\/tr>\n<tr>\n<td>hello.s<\/td>\n<td>\u8f93\u5165&#xff1a;\u6c47\u7f16\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-o hello.o<\/td>\n<td>\u8f93\u51fa&#xff1a;\u4e8c\u8fdb\u5236\u76ee\u6807\u6587\u4ef6 .o&#xff08;ELF \u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"gcc%20%E9%93%BE%E6%8E%A5%E5%8F%AF%E9%87%8D%E5%AE%9A%E4%BD%8D%E6%96%87%E4%BB%B6\">gcc \u94fe\u63a5\u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6<\/h3>\n<p>gcc hello.o -o hello    #\u672b\u5c3e\u52a0\u4e0a-v\u628a\u4fe1\u606f\u5168\u90e8\u6253\u5370\u51fa\u6765<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"290\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111730-6aa291caaa6cb.png\" width=\"713\" \/><\/p>\n<table>\n<tr>\u7247\u6bb5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>collect2<\/td>\n<td>GCC \u7684\u94fe\u63a5\u5668\u5c01\u88c5&#xff0c;\u5185\u90e8\u6700\u7ec8\u8c03\u7528 ld<\/td>\n<\/tr>\n<tr>\n<td>crt1.o \/ crti.o \/ crtbegin.o<\/td>\n<td>C \u8fd0\u884c\u65f6\u542f\u52a8\u6587\u4ef6&#xff0c;\u5305\u542b _start \u5165\u53e3&#xff0c;\u8d1f\u8d23\u8c03\u7528 _libc_start_main \u2192 main<\/td>\n<\/tr>\n<tr>\n<td>hello.o<\/td>\n<td>\u6211\u4eec\u81ea\u5df1\u7f16\u8bd1\u7684\u76ee\u6807\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>crtend.o \/ crtn.o<\/td>\n<td>\u8fd0\u884c\u65f6\u6536\u5c3e\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-lc<\/td>\n<td>\u94fe\u63a5 libc \u6807\u51c6 C \u5e93&#xff08;printf \u5c31\u5728\u8fd9\u91cc&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-o hello<\/td>\n<td>\u8f93\u51fa\u6700\u7ec8\u53ef\u6267\u884c\u7a0b\u5e8f<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u597d&#xff0c;\u63a5\u4e0b\u6765\u7684\u4e00\u6bb5\u65f6\u95f4\u6211\u5c06\u5f00\u59cb\u5b66\u4e60\u91ce\u706b\u7684Linux\u7cfb\u7edf\u8bfe\u7a0b\u5e76\u5c06\u5b66\u4e60\u5230\u7684\u5e72\u8d27\u9010\u6b65\u66f4\u65b0\u5230\u6211\u7684CSDN\u535a\u5ba2\u4e2d\u3002\u6ca1\u65f6\u95f4\u5237\u8bfe\u7684\u540c\u5b66\u53ef\u4ee5\u628a\u6211\u7684\u535a\u5ba2\u5582\u7ed9AI \u7a81\u51fb\u4e00\u4e0b\u3002<br \/>\n\u76ee\u5f55<br \/>\n\u4e09\u4e2a\u95ee\u9898<br \/>\n1\u3001\u4e86\u89e3 Hello World \u7a0b\u5e8f\u7684\u6267\u884c\u8fc7\u7a0b\u6709\u4ec0\u4e48\u7528&#xff1f;<br \/>\n2\u3001\u88f8\u673a\u5f00\u53d1\u4e2d\u7684 HelloWorld \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f;<br \/>\n3\u3001Linux \u7cfb\u7edf\u4e0b\u7684 Hello World \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f;<br \/>\n\u9636\u6bb5\u4e00&#xff1a;GCC \u7f16\u8bd1\u56db\u6b65<br \/>\n\u9636\u6bb5\u4e8c<\/p>\n","protected":false},"author":2,"featured_media":103494,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-103500","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b - \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\/103500.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5927\u5bb6\u597d&#xff0c;\u63a5\u4e0b\u6765\u7684\u4e00\u6bb5\u65f6\u95f4\u6211\u5c06\u5f00\u59cb\u5b66\u4e60\u91ce\u706b\u7684Linux\u7cfb\u7edf\u8bfe\u7a0b\u5e76\u5c06\u5b66\u4e60\u5230\u7684\u5e72\u8d27\u9010\u6b65\u66f4\u65b0\u5230\u6211\u7684CSDN\u535a\u5ba2\u4e2d\u3002\u6ca1\u65f6\u95f4\u5237\u8bfe\u7684\u540c\u5b66\u53ef\u4ee5\u628a\u6211\u7684\u535a\u5ba2\u5582\u7ed9AI \u7a81\u51fb\u4e00\u4e0b\u3002 \u76ee\u5f55 \u4e09\u4e2a\u95ee\u9898 1\u3001\u4e86\u89e3 Hello World \u7a0b\u5e8f\u7684\u6267\u884c\u8fc7\u7a0b\u6709\u4ec0\u4e48\u7528&#xff1f; 2\u3001\u88f8\u673a\u5f00\u53d1\u4e2d\u7684 HelloWorld \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f; 3\u3001Linux \u7cfb\u7edf\u4e0b\u7684 Hello World \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f; \u9636\u6bb5\u4e00&#xff1a;GCC \u7f16\u8bd1\u56db\u6b65 \u9636\u6bb5\u4e8c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/103500.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-10T11:17:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111729-6aa291c922580.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/103500.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/103500.html\",\"name\":\"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-10T11:17:31+00:00\",\"dateModified\":\"2026-09-10T11:17:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/103500.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/103500.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/103500.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b\"}]},{\"@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":"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b - \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\/103500.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5927\u5bb6\u597d&#xff0c;\u63a5\u4e0b\u6765\u7684\u4e00\u6bb5\u65f6\u95f4\u6211\u5c06\u5f00\u59cb\u5b66\u4e60\u91ce\u706b\u7684Linux\u7cfb\u7edf\u8bfe\u7a0b\u5e76\u5c06\u5b66\u4e60\u5230\u7684\u5e72\u8d27\u9010\u6b65\u66f4\u65b0\u5230\u6211\u7684CSDN\u535a\u5ba2\u4e2d\u3002\u6ca1\u65f6\u95f4\u5237\u8bfe\u7684\u540c\u5b66\u53ef\u4ee5\u628a\u6211\u7684\u535a\u5ba2\u5582\u7ed9AI \u7a81\u51fb\u4e00\u4e0b\u3002 \u76ee\u5f55 \u4e09\u4e2a\u95ee\u9898 1\u3001\u4e86\u89e3 Hello World \u7a0b\u5e8f\u7684\u6267\u884c\u8fc7\u7a0b\u6709\u4ec0\u4e48\u7528&#xff1f; 2\u3001\u88f8\u673a\u5f00\u53d1\u4e2d\u7684 HelloWorld \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f; 3\u3001Linux \u7cfb\u7edf\u4e0b\u7684 Hello World \u7a0b\u5e8f\u662f\u600e\u4e48\u6267\u884c\u7684&#xff1f; \u9636\u6bb5\u4e00&#xff1a;GCC \u7f16\u8bd1\u56db\u6b65 \u9636\u6bb5\u4e8c","og_url":"https:\/\/www.wsisp.com\/helps\/103500.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-10T11:17:31+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260910111729-6aa291c922580.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/103500.html","url":"https:\/\/www.wsisp.com\/helps\/103500.html","name":"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-10T11:17:31+00:00","dateModified":"2026-09-10T11:17:31+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/103500.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/103500.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/103500.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c\u5341\u516b\u8bb2\uff1aLinux\u4e0b\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b"}]},{"@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\/103500","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=103500"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/103500\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/103494"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=103500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=103500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=103500"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=103500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}