{"id":2328,"date":"2025-12-21T17:19:00","date_gmt":"2025-12-21T09:19:00","guid":{"rendered":"https:\/\/www.zhiwanyuzhou.com\/?p=2328"},"modified":"2025-12-22T17:30:51","modified_gmt":"2025-12-22T09:30:51","slug":"elf%e6%96%87%e4%bb%b6%e7%bb%93%e6%9e%84","status":"publish","type":"post","link":"https:\/\/www.zhiwanyuzhou.com\/index.php\/2025\/12\/21\/elf%e6%96%87%e4%bb%b6%e7%bb%93%e6%9e%84\/","title":{"rendered":"ELF\u6587\u4ef6\u7ed3\u6784"},"content":{"rendered":"\n<h2>\u4e00\u3001\u7b80\u4ecb<\/h2>\n\n\n\n<p>ELF\u4ee3\u8868Executable and Linkable Format\uff0c\u662f\u7c7bUnix\u5e73\u53f0\u6700\u901a\u7528\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f\uff0c\u5d4c\u5165\u5f0f\u8bbe\u5907\u5f88\u591a\u90fd\u662fLinux\u7cfb\u7edf\uff0c\u5b83\u91cc\u9762\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u5c31\u662fELF\u683c\u5f0f\uff0c\u5305\u542b\u4ee5\u4e0b\u4e09\u79cd\u60c5\u51b5\uff1a<\/p>\n\n\n\n<ul>\n<li>\u76ee\u6807\u6587\u4ef6.o<\/li>\n\n\n\n<li>\u52a8\u6001\u5e93\u6587\u4ef6.so<\/li>\n\n\n\n<li>.o\u548c.so\u94fe\u63a5\u5f97\u5230\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6<\/li>\n<\/ul>\n\n\n\n<h2>\u4e8c\u3001\u751f\u6210ELF\u6587\u4ef6<\/h2>\n\n\n\n<h3>1\u3001\u793a\u4f8b\u4ee3\u7801<\/h3>\n\n\n\n<p>hello.c<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>#include&lt;stdio.h&gt;\n\nint main(int argc,char *argv&#91;])\n{\n    printf(\"Hello World!\\n\");\n    return 0 ;\n}<\/code><\/pre>\n\n\n\n<h3>2\u3001\u9884\u7f16\u8bd1<\/h3>\n\n\n\n<p>\u89e3\u91ca\uff1a\u6e90\u6587\u4ef6hello.c\u548c\u76f8\u5173\u7684\u5934\u6587\u4ef6\u4f1a\u88ab\u9884\u7f16\u8bd1\u5668\u9884\u7f16\u8bd1\u6210\u4e3a\u4e00\u4e2a.i\u6587\u4ef6<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1agcc -E hello.c -o hello.i\uff0c\u5904\u7406\u540e\u7ed3\u679c\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code># 1 \"hello.c\"\n# 1 \"&lt;built-in&gt;\"\n# 1 \"&lt;command-line&gt;\"\n# 31 \"&lt;command-line&gt;\"\n# 1 \"\/usr\/include\/stdc-predef.h\" 1 3 4\n# 32 \"&lt;command-line&gt;\" 2\n# 1 \"hello.c\"\n# 1 \"\/usr\/include\/stdio.h\" 1 3 4\n# 27 \"\/usr\/include\/stdio.h\" 3 4\n# 1 \"\/usr\/include\/x86_64-linux-gnu\/bits\/libc-header-start.h\" 1 3 4\n# 33 \"\/usr\/include\/x86_64-linux-gnu\/bits\/libc-header-start.h\" 3 4\n# 1 \"\/usr\/include\/features.h\" 1 3 4\n# 461 \"\/usr\/include\/features.h\" 3 4\n......\nextern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));\n# 858 \"\/usr\/include\/stdio.h\" 3 4\nextern int __uflow (FILE *);\nextern int __overflow (FILE *, int);\n# 873 \"\/usr\/include\/stdio.h\" 3 4\n\n# 2 \"hello.c\" 2\n\n\n# 3 \"hello.c\"\nint main(int argc,char *argv&#91;])\n{\n    printf(\"Hello World!\\n\");\n    return 0 ;\n}<\/code><\/pre>\n\n\n\n<h3>3\u3001\u7f16\u8bd1<\/h3>\n\n\n\n<p>\u89e3\u91ca\uff1a\u7f16\u8bd1\u8fc7\u7a0b\u5c31\u662f\u5c06\u9884\u5904\u7406\u5b8c\u7684\u6587\u4ef6\u8fdb\u884c\u4e00\u7cfb\u5217\u7684\u8bcd\u6cd5\u5206\u6790\uff0c\u8bed\u6cd5\u5206\u6790\uff0c\u8bed\u4e49\u5206\u6790\u4ee5\u53ca\u4f18\u5316\u540e\u751f\u6210\u76f8\u5e94\u7684\u6c47\u7f16\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1agcc -S hello.c -o hello.s\uff0c\u5904\u7406\u540e\u7684\u5185\u5bb9\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>\t.file\t\"hello.c\"\n\t.text\n\t.section\t.rodata\n.LC0:\n\t.string\t\"Hello World!\"\n\t.text\n\t.globl\tmain\n\t.type\tmain, @function\nmain:\n.LFB0:\n\t.cfi_startproc\n\tendbr64\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset 6, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register 6\n\tsubq\t$16, %rsp\n\tmovl\t%edi, -4(%rbp)\n\tmovq\t%rsi, -16(%rbp)\n\tleaq\t.LC0(%rip), %rdi\n\tcall\tputs@PLT\n\tmovl\t$0, %eax\n\tleave\n\t.cfi_def_cfa 7, 8\n\tret\n\t.cfi_endproc\n.LFE0:\n\t.size\tmain, .-main\n\t.ident\t\"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0\"\n\t.section\t.note.GNU-stack,\"\",@progbits\n\t.section\t.note.gnu.property,\"a\"\n\t.align 8\n\t.long\t 1f - 0f\n\t.long\t 4f - 1f\n\t.long\t 5\n0:\n\t.string\t \"GNU\"\n1:\n\t.align 8\n\t.long\t 0xc0000002\n\t.long\t 3f - 2f\n2:\n\t.long\t 0x3\n3:\n\t.align 8\n4:<\/code><\/pre>\n\n\n\n<h3>4\u3001\u6c47\u7f16<\/h3>\n\n\n\n<p>\u89e3\u91ca\uff1a \u6c47\u7f16\u5668\u662f\u5c06\u6c47\u7f16\u4ee3\u7801\u8f6c\u53d8\u6210\u673a\u5668\u53ef\u4ee5\u6267\u884c\u7684\u6307\u4ee4\uff0c\u6bcf\u4e00\u4e2a\u6c47\u7f16\u8bed\u53e5\u51e0\u4e4e\u90fd\u5bf9\u5e94\u4e00\u6761\u673a\u5668\u6307\u4ee4\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1agcc -c hello.c -o hello.o\uff0c\u6216\u8005as&nbsp;hello.s&nbsp;-o&nbsp;hello.o\uff0c\u5904\u7406\u540e\u7684\u5185\u5bb9\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>$ hexdump -C hello.o\n00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|\n00000010  01 00 3e 00 01 00 00 00  00 00 00 00 00 00 00 00  |..&gt;.............|\n00000020  00 00 00 00 00 00 00 00  20 03 00 00 00 00 00 00  |........ .......|\n00000030  00 00 00 00 40 00 00 00  00 00 40 00 0e 00 0d 00  |....@.....@.....|\n00000040  f3 0f 1e fa 55 48 89 e5  48 83 ec 10 89 7d fc 48  |....UH..H....}.H|\n00000050  89 75 f0 48 8d 3d 00 00  00 00 e8 00 00 00 00 b8  |.u.H.=..........|\n00000060  00 00 00 00 c9 c3 48 65  6c 6c 6f 20 57 6f 72 6c  |......Hello Worl|\n00000070  64 21 00 00 47 43 43 3a  20 28 55 62 75 6e 74 75  |d!..GCC: (Ubuntu|\n00000080  20 39 2e 34 2e 30 2d 31  75 62 75 6e 74 75 31 7e  | 9.4.0-1ubuntu1~|\n00000090  32 30 2e 30 34 2e 32 29  20 39 2e 34 2e 30 00 00  |20.04.2) 9.4.0..|\n000000a0  04 00 00 00 10 00 00 00  05 00 00 00 47 4e 55 00  |............GNU.|\n000000b0  02 00 00 c0 04 00 00 00  03 00 00 00 00 00 00 00  |................|\n000000c0  14 00 00 00 00 00 00 00  01 7a 52 00 01 78 10 01  |.........zR..x..|\n000000d0  1b 0c 07 08 90 01 00 00  1c 00 00 00 1c 00 00 00  |................|\n000000e0  00 00 00 00 26 00 00 00  00 45 0e 10 86 02 43 0d  |....&amp;....E....C.|\n000000f0  06 5d 0c 07 08 00 00 00  00 00 00 00 00 00 00 00  |.]..............|\n00000100  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000110  01 00 00 00 04 00 f1 ff  00 00 00 00 00 00 00 00  |................|\n00000120  00 00 00 00 00 00 00 00  00 00 00 00 03 00 01 00  |................|\n00000130  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000140  00 00 00 00 03 00 03 00  00 00 00 00 00 00 00 00  |................|\n00000150  00 00 00 00 00 00 00 00  00 00 00 00 03 00 04 00  |................|\n00000160  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000170  00 00 00 00 03 00 05 00  00 00 00 00 00 00 00 00  |................|\n00000180  00 00 00 00 00 00 00 00  00 00 00 00 03 00 07 00  |................|\n00000190  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n000001a0  00 00 00 00 03 00 08 00  00 00 00 00 00 00 00 00  |................|\n000001b0  00 00 00 00 00 00 00 00  00 00 00 00 03 00 09 00  |................|\n000001c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n000001d0  00 00 00 00 03 00 06 00  00 00 00 00 00 00 00 00  |................|\n000001e0  00 00 00 00 00 00 00 00  09 00 00 00 12 00 01 00  |................|\n000001f0  00 00 00 00 00 00 00 00  26 00 00 00 00 00 00 00  |........&amp;.......|\n00000200  0e 00 00 00 10 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000210  00 00 00 00 00 00 00 00  24 00 00 00 10 00 00 00  |........$.......|\n00000220  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000230  00 68 65 6c 6c 6f 2e 63  00 6d 61 69 6e 00 5f 47  |.hello.c.main._G|\n00000240  4c 4f 42 41 4c 5f 4f 46  46 53 45 54 5f 54 41 42  |LOBAL_OFFSET_TAB|\n00000250  4c 45 5f 00 70 75 74 73  00 00 00 00 00 00 00 00  |LE_.puts........|\n......<\/code><\/pre>\n\n\n\n<p>hello.o\u7684file\u4fe1\u606f<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"693\" height=\"39\" src=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image.png\" alt=\"\" class=\"wp-image-2329\" srcset=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image.png?v=1766382824 693w, https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-300x17.png?v=1766382824 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<h3>5\u3001\u94fe\u63a5<\/h3>\n\n\n\n<p>\u89e3\u91ca\uff1a \u94fe\u63a5\u7684\u4e3b\u8981\u5185\u5bb9\u5c31\u662f\u628a\u5404\u4e2a\u6a21\u5757\u4e4b\u95f4\u76f8\u4e92\u5f15\u7528\u7684\u90e8\u5206\u90fd\u5904\u7406\u597d\uff0c\u4f7f\u5f97\u5404\u4e2a\u6a21\u5757\u4e4b\u95f4\u80fd\u591f\u6b63\u786e\u7684\u8854\u63a5\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\uff1agcc hello.o -o hello\uff0c\u6216\u8005ld&nbsp;hello.o&nbsp;-o&nbsp;hello\uff0c\u5904\u7406\u540e\u7684\u5185\u5bb9\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>$ hexdump -C hello\n00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|\n00000010  03 00 3e 00 01 00 00 00  60 10 00 00 00 00 00 00  |..&gt;.....`.......|\n00000020  40 00 00 00 00 00 00 00  78 39 00 00 00 00 00 00  |@.......x9......|\n00000030  00 00 00 00 40 00 38 00  0d 00 40 00 1f 00 1e 00  |....@.8...@.....|\n00000040  06 00 00 00 04 00 00 00  40 00 00 00 00 00 00 00  |........@.......|\n00000050  40 00 00 00 00 00 00 00  40 00 00 00 00 00 00 00  |@.......@.......|\n00000060  d8 02 00 00 00 00 00 00  d8 02 00 00 00 00 00 00  |................|\n00000070  08 00 00 00 00 00 00 00  03 00 00 00 04 00 00 00  |................|\n00000080  18 03 00 00 00 00 00 00  18 03 00 00 00 00 00 00  |................|\n00000090  18 03 00 00 00 00 00 00  1c 00 00 00 00 00 00 00  |................|\n000000a0  1c 00 00 00 00 00 00 00  01 00 00 00 00 00 00 00  |................|\n000000b0  01 00 00 00 04 00 00 00  00 00 00 00 00 00 00 00  |................|\n000000c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n000000d0  f8 05 00 00 00 00 00 00  f8 05 00 00 00 00 00 00  |................|\n000000e0  00 10 00 00 00 00 00 00  01 00 00 00 05 00 00 00  |................|\n000000f0  00 10 00 00 00 00 00 00  00 10 00 00 00 00 00 00  |................|\n00000100  00 10 00 00 00 00 00 00  f5 01 00 00 00 00 00 00  |................|\n00000110  f5 01 00 00 00 00 00 00  00 10 00 00 00 00 00 00  |................|\n00000120  01 00 00 00 04 00 00 00  00 20 00 00 00 00 00 00  |......... ......|\n00000130  00 20 00 00 00 00 00 00  00 20 00 00 00 00 00 00  |. ....... ......|\n00000140  60 01 00 00 00 00 00 00  60 01 00 00 00 00 00 00  |`.......`.......|\n00000150  00 10 00 00 00 00 00 00  01 00 00 00 06 00 00 00  |................|\n00000160  b8 2d 00 00 00 00 00 00  b8 3d 00 00 00 00 00 00  |.-.......=......|\n00000170  b8 3d 00 00 00 00 00 00  58 02 00 00 00 00 00 00  |.=......X.......|\n00000180  60 02 00 00 00 00 00 00  00 10 00 00 00 00 00 00  |`...............|\n00000190  02 00 00 00 06 00 00 00  c8 2d 00 00 00 00 00 00  |.........-......|\n000001a0  c8 3d 00 00 00 00 00 00  c8 3d 00 00 00 00 00 00  |.=.......=......|\n000001b0  f0 01 00 00 00 00 00 00  f0 01 00 00 00 00 00 00  |................|\n000001c0  08 00 00 00 00 00 00 00  04 00 00 00 04 00 00 00  |................|\n000001d0  38 03 00 00 00 00 00 00  38 03 00 00 00 00 00 00  |8.......8.......|\n000001e0  38 03 00 00 00 00 00 00  20 00 00 00 00 00 00 00  |8....... .......|\n000001f0  20 00 00 00 00 00 00 00  08 00 00 00 00 00 00 00  | ...............|\n00000200  04 00 00 00 04 00 00 00  58 03 00 00 00 00 00 00  |........X.......|\n00000210  58 03 00 00 00 00 00 00  58 03 00 00 00 00 00 00  |X.......X.......|\n00000220  44 00 00 00 00 00 00 00  44 00 00 00 00 00 00 00  |D.......D.......|\n00000230  04 00 00 00 00 00 00 00  53 e5 74 64 04 00 00 00  |........S.td....|\n00000240  38 03 00 00 00 00 00 00  38 03 00 00 00 00 00 00  |8.......8.......|\n00000250  38 03 00 00 00 00 00 00  20 00 00 00 00 00 00 00  |8....... .......|\n00000260  20 00 00 00 00 00 00 00  08 00 00 00 00 00 00 00  | ...............|\n00000270  50 e5 74 64 04 00 00 00  14 20 00 00 00 00 00 00  |P.td..... ......|\n00000280  14 20 00 00 00 00 00 00  14 20 00 00 00 00 00 00  |. ....... ......|\n00000290  44 00 00 00 00 00 00 00  44 00 00 00 00 00 00 00  |D.......D.......|\n000002a0  04 00 00 00 00 00 00 00  51 e5 74 64 06 00 00 00  |........Q.td....|\n000002b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n*\n000002d0  00 00 00 00 00 00 00 00  10 00 00 00 00 00 00 00  |................|\n000002e0  52 e5 74 64 04 00 00 00  b8 2d 00 00 00 00 00 00  |R.td.....-......|\n000002f0  b8 3d 00 00 00 00 00 00  b8 3d 00 00 00 00 00 00  |.=.......=......|\n00000300  48 02 00 00 00 00 00 00  48 02 00 00 00 00 00 00  |H.......H.......|\n00000310  01 00 00 00 00 00 00 00  2f 6c 69 62 36 34 2f 6c  |........\/lib64\/l|\n00000320  64 2d 6c 69 6e 75 78 2d  78 38 36 2d 36 34 2e 73  |d-linux-x86-64.s|\n00000330  6f 2e 32 00 00 00 00 00  04 00 00 00 10 00 00 00  |o.2.............|\n00000340  05 00 00 00 47 4e 55 00  02 00 00 c0 04 00 00 00  |....GNU.........|\n00000350  03 00 00 00 00 00 00 00  04 00 00 00 14 00 00 00  |................|\n00000360  03 00 00 00 47 4e 55 00  72 d0 7f ed d7 66 59 f9  |....GNU.r....fY.|\n00000370  5a a1 2c 69 f5 84 fa 89  f9 1c 33 72 04 00 00 00  |Z.,i......3r....|\n00000380  10 00 00 00 01 00 00 00  47 4e 55 00 00 00 00 00  |........GNU.....|\n00000390  03 00 00 00 02 00 00 00  00 00 00 00 00 00 00 00  |................|\n000003a0  02 00 00 00 06 00 00 00  01 00 00 00 06 00 00 00  |................|\n000003b0  00 00 81 00 00 00 00 00  06 00 00 00 00 00 00 00  |................|\n000003c0  d1 65 ce 6d 00 00 00 00  00 00 00 00 00 00 00 00  |.e.m............|\n000003d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n000003e0  3d 00 00 00 20 00 00 00  00 00 00 00 00 00 00 00  |=... ...........|\n000003f0  00 00 00 00 00 00 00 00  0b 00 00 00 12 00 00 00  |................|\n00000400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000410  1f 00 00 00 12 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000420  00 00 00 00 00 00 00 00  59 00 00 00 20 00 00 00  |........Y... ...|\n00000430  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000440  68 00 00 00 20 00 00 00  00 00 00 00 00 00 00 00  |h... ...........|\n00000450  00 00 00 00 00 00 00 00  10 00 00 00 22 00 00 00  |............\"...|\n00000460  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000470  00 6c 69 62 63 2e 73 6f  2e 36 00 70 75 74 73 00  |.libc.so.6.puts.|\n00000480  5f 5f 63 78 61 5f 66 69  6e 61 6c 69 7a 65 00 5f  |__cxa_finalize._|\n00000490  5f 6c 69 62 63 5f 73 74  61 72 74 5f 6d 61 69 6e  |_libc_start_main|\n000004a0  00 47 4c 49 42 43 5f 32  2e 32 2e 35 00 5f 49 54  |.GLIBC_2.2.5._IT|\n000004b0  4d 5f 64 65 72 65 67 69  73 74 65 72 54 4d 43 6c  |M_deregisterTMCl|\n000004c0  6f 6e 65 54 61 62 6c 65  00 5f 5f 67 6d 6f 6e 5f  |oneTable.__gmon_|\n000004d0  73 74 61 72 74 5f 5f 00  5f 49 54 4d 5f 72 65 67  |start__._ITM_reg|\n000004e0  69 73 74 65 72 54 4d 43  6c 6f 6e 65 54 61 62 6c  |isterTMCloneTabl|\n000004f0  65 00 00 00 00 00 02 00  02 00 00 00 00 00 02 00  |e...............|\n00000500  01 00 01 00 01 00 00 00  10 00 00 00 00 00 00 00  |................|\n00000510  75 1a 69 09 00 00 02 00  31 00 00 00 00 00 00 00  |u.i.....1.......|\n00000520  b8 3d 00 00 00 00 00 00  08 00 00 00 00 00 00 00  |.=..............|\n00000530  40 11 00 00 00 00 00 00  c0 3d 00 00 00 00 00 00  |@........=......|\n00000540  08 00 00 00 00 00 00 00  00 11 00 00 00 00 00 00  |................|\n00000550  08 40 00 00 00 00 00 00  08 00 00 00 00 00 00 00  |.@..............|\n00000560  08 40 00 00 00 00 00 00  d8 3f 00 00 00 00 00 00  |.@.......?......|\n00000570  06 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  |................|\n00000580  e0 3f 00 00 00 00 00 00  06 00 00 00 03 00 00 00  |.?..............|\n00000590  00 00 00 00 00 00 00 00  e8 3f 00 00 00 00 00 00  |.........?......|\n000005a0  06 00 00 00 04 00 00 00  00 00 00 00 00 00 00 00  |................|\n000005b0  f0 3f 00 00 00 00 00 00  06 00 00 00 05 00 00 00  |.?..............|\n000005c0  00 00 00 00 00 00 00 00  f8 3f 00 00 00 00 00 00  |.........?......|\n000005d0  06 00 00 00 06 00 00 00  00 00 00 00 00 00 00 00  |................|\n000005e0  d0 3f 00 00 00 00 00 00  07 00 00 00 02 00 00 00  |.?..............|\n000005f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n......\n00002000  01 00 02 00 48 65 6c 6c  6f 20 57 6f 72 6c 64 21  |....Hello World!|\n......<\/code><\/pre>\n\n\n\n<h2>\u4e09\u3001ELF\u6587\u4ef6\u89e3\u6790<\/h2>\n\n\n\n<p>ELF\u6587\u4ef6\u5934\u7684\u5b9a\u4e49\u53c2\u8003binutils\u6e90\u7801\uff08include\/elf\/internal.h\uff09\u6216\u8005linux\u5185\u6838\u6e90\u7801\uff08include\/uapi\/linux\/elf.h\uff09<\/p>\n\n\n\n<h3>1\u3001Elf64_Ehdr<\/h3>\n\n\n\n<p>(1) e_ident <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u504f\u79fb<\/td><td>\u5927\u5c0f<\/td><td>\u503c<\/td><td>\u8bf4\u660e<\/td><\/tr><tr><td>0x00-0x03<\/td><td>4<\/td><td>\\x7FELF<\/td><td>\u9b54\u672f\u5b57<\/td><\/tr><tr><td>0x04<\/td><td>1<\/td><td>2<\/td><td>ei_class\uff1aELFCLASS64\uff0c64\u4f4d<\/td><\/tr><tr><td>0x05<\/td><td>1<\/td><td>1<\/td><td>ei_data\uff1aELFDATA2LSB\uff0c\u5c0f\u7aef<\/td><\/tr><tr><td>0x06<\/td><td>1<\/td><td>1<\/td><td>ei_version\uff1aE_CURRENT<\/td><\/tr><tr><td>0x07<\/td><td>1<\/td><td>0<\/td><td>ei_osabi\uff1aELFOSABI_NONE<\/td><\/tr><tr><td>0x08<\/td><td>1<\/td><td>0<\/td><td>ei_abiversion\uff1a0<\/td><\/tr><tr><td>0x09-0x0E<\/td><td>6<\/td><td>0<\/td><td>ei_pad<\/td><\/tr><tr><td>0x0F<\/td><td>1<\/td><td>0<\/td><td>ei_nident_SIZE\uff1a0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>(2) \u5176\u4ed6<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u504f\u79fb<\/td><td>\u5927\u5c0f<\/td><td>\u503c<\/td><td>\u8bf4\u660e<\/td><\/tr><tr><td>0x10-0x11<\/td><td>2<\/td><td>3<\/td><td>e_type64\uff1aET_DYN\uff0c\u6587\u4ef6\u7c7b\u578b<\/td><\/tr><tr><td>0x12-0x13<\/td><td>2<\/td><td>0x3E<\/td><td>e_machine\uff1aEM_X86_64\uff0c\u673a\u5668\u67b6\u6784<\/td><\/tr><tr><td>0x14-0x17<\/td><td>4<\/td><td>1<\/td><td>e_version\uff1aEV_CURRENT\uff0c\u76ee\u6807\u6587\u4ef6\u7248\u672c<\/td><\/tr><tr><td>0x18-0x1F<\/td><td>8<\/td><td>0x1060<\/td><td>e_entry\uff0c\u5165\u53e3\u70b9\u5730\u5740<\/td><\/tr><tr><td>0x20-0x27<\/td><td>8<\/td><td>0x40<\/td><td>e_phoff\uff0cProgram header table file offset\uff0c\u7a0b\u5e8f\u5934\u90e8\u8868\u504f\u79fb<\/td><\/tr><tr><td>0x28-0x2F<\/td><td>8<\/td><td>0x3978<\/td><td>e_shoff\uff0cSection header table file offset\uff0c\u8282\u5934\u8868\u504f\u79fb<\/td><\/tr><tr><td>0x30-0x33<\/td><td>4<\/td><td>0<\/td><td>e_flags\uff0cProcessor-specific flags\uff0c\u6587\u4ef6\u4e2d\u4e0e\u7279\u5b9a\u5904\u7406\u5668\u76f8\u5173\u7684\u6807\u5fd7<\/td><\/tr><tr><td>0x34-0x35<\/td><td>2<\/td><td>0x40<\/td><td>e_ehsize\uff0cELF \u6587\u4ef6\u5934\u90e8\u7684\u5b57\u8282\u957f\u5ea6<\/td><\/tr><tr><td>0x36-0x37<\/td><td>2<\/td><td>0x38<\/td><td>e_phentsize\uff0cProgram header table entry size\uff0c\u7a0b\u5e8f\u5934\u90e8\u8868\u4e2d\u6bcf\u4e2a\u8868\u9879\u7684\u5b57\u8282\u957f\u5ea6<\/td><\/tr><tr><td>0x38-0x39<\/td><td>2<\/td><td>0x0D<\/td><td>e_phnum\uff0cProgram header table entry count\uff0c\u7a0b\u5e8f\u5934\u90e8\u8868\u7684\u9879\u6570<\/td><\/tr><tr><td>0x3A-0x3B<\/td><td>2<\/td><td>0x40<\/td><td>e_shentsize\uff0cSection header table entry size\uff0c\u8282\u5934\u7684\u5b57\u8282\u957f\u5ea6<\/td><\/tr><tr><td>0x3C-0x3D<\/td><td>2<\/td><td>0x1F<\/td><td>e_shnum\uff0cSection header table entry count\uff0c\u8282\u5934\u8868\u4e2d\u7684\u9879\u6570<\/td><\/tr><tr><td>0x3E-0x3F<\/td><td>2<\/td><td>0x1E<\/td><td>e_shstrndx\uff0cSection header string table index\uff0c\u8282\u5934\u8868\u4e2d\u4e0e\u8282\u540d\u5b57\u7b26\u4e32\u8868\u76f8\u5173\u7684\u8868\u9879\u7684\u7d22\u5f15\u503c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3>2\u3001Elf64_Phdr<\/h3>\n\n\n\n<p>\uff081\uff09\u7b2c\u4e00\u6bb5<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u504f\u79fb<\/td><td>\u5927\u5c0f<\/td><td>\u503c<\/td><td>\u8bf4\u660e<\/td><\/tr><tr><td>0x40-0x43<\/td><td>4<\/td><td>6<\/td><td>p_type\uff1aPT_PHDR\uff0c\u7a0b\u5e8f\u5934\uff0c\u6bb5\u7c7b\u578b<\/td><\/tr><tr><td>0x44-0x47<\/td><td>4<\/td><td>4<\/td><td>p_flags\uff1aPF_Read\uff0c\u53ef\u8bfb<\/td><\/tr><tr><td>0x48-0x4F<\/td><td>8<\/td><td>0x40<\/td><td>p_offset\uff0c\u6587\u4ef6\u504f\u79fb<\/td><\/tr><tr><td>0x50-0x57<\/td><td>8<\/td><td>0x40<\/td><td>p_vaddr\uff0c\u865a\u62df\u5730\u5740<\/td><\/tr><tr><td>0x58-0x5F<\/td><td>8<\/td><td>0x40<\/td><td>p_paddr\uff0c\u7269\u7406\u5730\u5740<\/td><\/tr><tr><td>0x60-0x67<\/td><td>8<\/td><td>0x2D8<\/td><td>p_filesz\uff0c\u6587\u4ef6\u4e2d\u6bb5\u5927\u5c0f<\/td><\/tr><tr><td>0x68-0x6F<\/td><td>8<\/td><td>0x2D8<\/td><td>p_memsz\uff0c\u5185\u5b58\u4e2d\u6bb5\u5927\u5c0f<\/td><\/tr><tr><td>0x70-0x77<\/td><td>8<\/td><td>0x08<\/td><td>p_align\uff0cSegment alignment, file &amp; memory\uff0c\u5bf9\u9f50<\/td><\/tr><tr><td>0x78-0x317<\/td><td>0x2A0<\/td><td>...<\/td><td>\u6b64\u6bb5\u7684\u5269\u4f59\u5185\u5bb9<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\uff082\uff09\u5176\u4ed6\u6bb5\u7c7b\u4f3c\u7b2c\u4e00\u6bb5\u89e3\u6790\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7528readelf -S hello\u89e3\u6790<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>$ readelf -l hello\n\nElf file type is DYN (Shared object file)\nEntry point 0x1060\nThere are 13 program headers, starting at offset 64\n\nProgram Headers:\n  Type           Offset             VirtAddr           PhysAddr\n                 FileSiz            MemSiz              Flags  Align\n  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040\n                 0x00000000000002d8 0x00000000000002d8  R      0x8\n  INTERP         0x0000000000000318 0x0000000000000318 0x0000000000000318\n                 0x000000000000001c 0x000000000000001c  R      0x1\n      &#91;Requesting program interpreter: \/lib64\/ld-linux-x86-64.so.2]\n  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000\n                 0x00000000000005f8 0x00000000000005f8  R      0x1000\n  LOAD           0x0000000000001000 0x0000000000001000 0x0000000000001000\n                 0x00000000000001f5 0x00000000000001f5  R E    0x1000\n  LOAD           0x0000000000002000 0x0000000000002000 0x0000000000002000\n                 0x0000000000000160 0x0000000000000160  R      0x1000\n  LOAD           0x0000000000002db8 0x0000000000003db8 0x0000000000003db8\n                 0x0000000000000258 0x0000000000000260  RW     0x1000\n  DYNAMIC        0x0000000000002dc8 0x0000000000003dc8 0x0000000000003dc8\n                 0x00000000000001f0 0x00000000000001f0  RW     0x8\n  NOTE           0x0000000000000338 0x0000000000000338 0x0000000000000338\n                 0x0000000000000020 0x0000000000000020  R      0x8\n  NOTE           0x0000000000000358 0x0000000000000358 0x0000000000000358\n                 0x0000000000000044 0x0000000000000044  R      0x4\n  GNU_PROPERTY   0x0000000000000338 0x0000000000000338 0x0000000000000338\n                 0x0000000000000020 0x0000000000000020  R      0x8\n  GNU_EH_FRAME   0x0000000000002014 0x0000000000002014 0x0000000000002014\n                 0x0000000000000044 0x0000000000000044  R      0x4\n  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000\n                 0x0000000000000000 0x0000000000000000  RW     0x10\n  GNU_RELRO      0x0000000000002db8 0x0000000000003db8 0x0000000000003db8\n                 0x0000000000000248 0x0000000000000248  R      0x1\n\n Section to Segment mapping:\n  Segment Sections...\n   00     \n   01     .interp \n   02     .interp .note.gnu.property .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt \n   03     .init .plt .plt.got .plt.sec .text .fini \n   04     .rodata .eh_frame_hdr .eh_frame \n   05     .init_array .fini_array .dynamic .got .data .bss \n   06     .dynamic \n   07     .note.gnu.property \n   08     .note.gnu.build-id .note.ABI-tag \n   09     .note.gnu.property \n   10     .eh_frame_hdr \n   11     \n   12     .init_array .fini_array .dynamic .got<\/code><\/pre>\n\n\n\n<h3>3\u3001Elf64_Shdr<\/h3>\n\n\n\n<p>\uff081\uff09\u7b2c\u4e00\u8282\u6ca1\u6709\u540d\u5b57\uff0c\u8fd9\u91cc\u4ee5\u7b2c\u4e8c\u8282\u4e3a\u4f8b<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u504f\u79fb<\/td><td>\u5927\u5c0f<\/td><td>\u503c<\/td><td>\u8bf4\u660e<\/td><\/tr><tr><td>0x39B8-0x39BB<\/td><td>4<\/td><td>0x1B<\/td><td>sh_name\uff0c\u5bf9\u5e94.interp\uff0c\u8282\u540d\u79f0\uff0c\u5bf9\u5e94string tbl\u7684\u504f\u79fb<\/td><\/tr><tr><td>0x39BC-0x39BF<\/td><td>4<\/td><td>1<\/td><td>s_type\uff1aSHT_PROGBITS\uff0c\u8282\u7c7b\u578b<\/td><\/tr><tr><td>0x39C0-0x39C7<\/td><td>8<\/td><td>2<\/td><td>s_flags\uff1aAlLOC\uff0cMiscellaneous section attributes<\/td><\/tr><tr><td>0x39C8-0x39CF<\/td><td>8<\/td><td>0x318<\/td><td>s_addr\uff0cSection virtual addr at execution\uff0c\u8282\u865a\u62df\u5730\u5740<\/td><\/tr><tr><td>0x39D0-0x39D7<\/td><td>8<\/td><td>0x318<\/td><td>s_offset\uff0cSection file offset\uff0c\u8282\u6587\u4ef6\u504f\u79fb<\/td><\/tr><tr><td>0x39D8-0x39DF<\/td><td>8<\/td><td>0x1C<\/td><td>s_size\uff0cSize of section in bytes\uff0c\u8282\u5927\u5c0f<\/td><\/tr><tr><td>0x39E0-0x39E3<\/td><td>4<\/td><td>0<\/td><td>s_link\uff0cIndex of another section\uff0c\u5176\u4ed6\u8282\u504f\u79fb<\/td><\/tr><tr><td>0x39E4-0x39E7<\/td><td>4<\/td><td>0<\/td><td>s_info\uff0cAdditional section information\uff0c\u53ef\u9009\u8282\u4fe1\u606f<\/td><\/tr><tr><td>0x39E8-0x39EF<\/td><td>8<\/td><td>1<\/td><td>s_addralign\uff0cSection alignment\uff0c\u8282\u5bf9\u9f50<\/td><\/tr><tr><td>0x39F0-0x39F7<\/td><td>8<\/td><td>0<\/td><td>entsize\uff0cEntry size if section holds table<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u5bf9\u5e94\u7684\u5185\u5bb9<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"410\" src=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-1.png\" alt=\"\" class=\"wp-image-2337\" srcset=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-1.png?v=1766391733 584w, https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-1-300x211.png?v=1766391733 300w\" sizes=\"(max-width: 584px) 100vw, 584px\" \/><\/figure>\n\n\n\n<p>\/lib64\/ld-linux-x86-64.so.2<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"611\" height=\"88\" src=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-2.png\" alt=\"\" class=\"wp-image-2338\" srcset=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-2.png?v=1766392428 611w, https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-2-300x43.png?v=1766392428 300w\" sizes=\"(max-width: 611px) 100vw, 611px\" \/><\/figure>\n\n\n\n<p>\uff082\uff09\u5176\u4ed6\u8282\u7c7b\u4f3c\u7b2c\u4e00\u8282\u89e3\u6790\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7528readelf -S hello\u89e3\u6790<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>$ readelf -S hello\nThere are 31 section headers, starting at offset 0x3978:\n\nSection Headers:\n  &#91;Nr] Name              Type             Address           Offset\n       Size              EntSize          Flags  Link  Info  Align\n  &#91; 0]                   NULL             0000000000000000  00000000\n       0000000000000000  0000000000000000           0     0     0\n  &#91; 1] .interp           PROGBITS         0000000000000318  00000318\n       000000000000001c  0000000000000000   A       0     0     1\n  &#91; 2] .note.gnu.propert NOTE             0000000000000338  00000338\n       0000000000000020  0000000000000000   A       0     0     8\n  &#91; 3] .note.gnu.build-i NOTE             0000000000000358  00000358\n       0000000000000024  0000000000000000   A       0     0     4\n  &#91; 4] .note.ABI-tag     NOTE             000000000000037c  0000037c\n       0000000000000020  0000000000000000   A       0     0     4\n  &#91; 5] .gnu.hash         GNU_HASH         00000000000003a0  000003a0\n       0000000000000024  0000000000000000   A       6     0     8\n  &#91; 6] .dynsym           DYNSYM           00000000000003c8  000003c8\n       00000000000000a8  0000000000000018   A       7     1     8\n  &#91; 7] .dynstr           STRTAB           0000000000000470  00000470\n       0000000000000082  0000000000000000   A       0     0     1\n  &#91; 8] .gnu.version      VERSYM           00000000000004f2  000004f2\n       000000000000000e  0000000000000002   A       6     0     2\n  &#91; 9] .gnu.version_r    VERNEED          0000000000000500  00000500\n       0000000000000020  0000000000000000   A       7     1     8\n  &#91;10] .rela.dyn         RELA             0000000000000520  00000520\n       00000000000000c0  0000000000000018   A       6     0     8\n  &#91;11] .rela.plt         RELA             00000000000005e0  000005e0\n       0000000000000018  0000000000000018  AI       6    24     8\n  &#91;12] .init             PROGBITS         0000000000001000  00001000\n       000000000000001b  0000000000000000  AX       0     0     4\n  &#91;13] .plt              PROGBITS         0000000000001020  00001020\n       0000000000000020  0000000000000010  AX       0     0     16\n  &#91;14] .plt.got          PROGBITS         0000000000001040  00001040\n       0000000000000010  0000000000000010  AX       0     0     16\n  &#91;15] .plt.sec          PROGBITS         0000000000001050  00001050\n       0000000000000010  0000000000000010  AX       0     0     16\n  &#91;16] .text             PROGBITS         0000000000001060  00001060\n       0000000000000185  0000000000000000  AX       0     0     16\n  &#91;17] .fini             PROGBITS         00000000000011e8  000011e8\n       000000000000000d  0000000000000000  AX       0     0     4\n  &#91;18] .rodata           PROGBITS         0000000000002000  00002000\n       0000000000000011  0000000000000000   A       0     0     4\n  &#91;19] .eh_frame_hdr     PROGBITS         0000000000002014  00002014\n       0000000000000044  0000000000000000   A       0     0     4\n  &#91;20] .eh_frame         PROGBITS         0000000000002058  00002058\n       0000000000000108  0000000000000000   A       0     0     8\n  &#91;21] .init_array       INIT_ARRAY       0000000000003db8  00002db8\n       0000000000000008  0000000000000008  WA       0     0     8\n  &#91;22] .fini_array       FINI_ARRAY       0000000000003dc0  00002dc0\n       0000000000000008  0000000000000008  WA       0     0     8\n  &#91;23] .dynamic          DYNAMIC          0000000000003dc8  00002dc8\n       00000000000001f0  0000000000000010  WA       7     0     8\n  &#91;24] .got              PROGBITS         0000000000003fb8  00002fb8\n       0000000000000048  0000000000000008  WA       0     0     8\n  &#91;25] .data             PROGBITS         0000000000004000  00003000\n       0000000000000010  0000000000000000  WA       0     0     8\n  &#91;26] .bss              NOBITS           0000000000004010  00003010\n       0000000000000008  0000000000000000  WA       0     0     1\n  &#91;27] .comment          PROGBITS         0000000000000000  00003010\n       000000000000002b  0000000000000001  MS       0     0     1\n  &#91;28] .symtab           SYMTAB           0000000000000000  00003040\n       0000000000000618  0000000000000018          29    46     8\n  &#91;29] .strtab           STRTAB           0000000000000000  00003658\n       0000000000000203  0000000000000000           0     0     1\n  &#91;30] .shstrtab         STRTAB           0000000000000000  0000385b\n       000000000000011a  0000000000000000           0     0     1\nKey to Flags:\n  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),\n  L (link order), O (extra OS processing required), G (group), T (TLS),\n  C (compressed), x (unknown), o (OS specific), E (exclude),\n  l (large), p (processor specific)\n<\/code><\/pre>\n\n\n\n<h3>4\u3001Elf64_Sym<\/h3>\n\n\n\n<p>(1) \u7b2c29\u4e2a\u7b26\u53f7\u8868<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u504f\u79fb<\/td><td>\u5927\u5c0f<\/td><td>\u503c<\/td><td>\u8bf4\u660e<\/td><\/tr><tr><td>0x32E0-0x32E3<\/td><td>4<\/td><td>1<\/td><td>st_name\uff0c\u504f\u79fb\u5bf9\u5e94crtstuff.c<\/td><\/tr><tr><td>0x32E4<\/td><td>1<\/td><td>4<\/td><td>sym_info\uff1aSTB_LOCAL | STT_FILE<\/td><\/tr><tr><td>0x32E5<\/td><td>1<\/td><td>0<\/td><td>sym_other<\/td><\/tr><tr><td>0x32E6-0x32E7<\/td><td>2<\/td><td>0xFFF1<\/td><td>sym_shndx\uff0cAssociated section index\uff0c\u5173\u8054\u8282\u7d22\u5f15<\/td><\/tr><tr><td>0x32E8-0x32EF<\/td><td>8<\/td><td>0<\/td><td>sym_value\uff0cValue of the symbol\uff0c\u7b26\u53f7\u503c<\/td><\/tr><tr><td>0x32F0-0x32F7<\/td><td>8<\/td><td>0<\/td><td>sym_size\uff0cAssociated symbol size\uff0c\u5173\u8054\u7b26\u53f7\u5927\u5c0f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u540d\u5b57<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"585\" height=\"167\" src=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-3.png\" alt=\"\" class=\"wp-image-2339\" srcset=\"https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-3.png?v=1766394402 585w, https:\/\/www.zhiwanyuzhou.com\/wp-content\/uploads\/2025\/12\/image-3-300x86.png?v=1766394402 300w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/figure>\n\n\n\n<p>\uff082\uff09\u5176\u4ed6\u7b26\u53f7\u8868\u7c7b\u4f3c\u7b2c\u4e00\u4e2a\u7b26\u53f7\u8868\u89e3\u6790\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7528readelf -s hello\u89e3\u6790<\/p>\n\n\n\n<pre class=\"wp-block-code has-palette-color-4-color has-palette-color-8-background-color has-text-color has-background\"><code>$ readelf -s hello\n\nSymbol table '.dynsym' contains 7 entries:\n   Num:    Value          Size Type    Bind   Vis      Ndx Name\n     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND \n     1: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_deregisterTMCloneTab\n     2: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND puts@GLIBC_2.2.5 (2)\n     3: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __libc_start_main@GLIBC_2.2.5 (2)\n     4: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__\n     5: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_registerTMCloneTable\n     6: 0000000000000000     0 FUNC    WEAK   DEFAULT  UND __cxa_finalize@GLIBC_2.2.5 (2)\n\nSymbol table '.symtab' contains 65 entries:\n   Num:    Value          Size Type    Bind   Vis      Ndx Name\n     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND \n     1: 0000000000000318     0 SECTION LOCAL  DEFAULT    1 \n     2: 0000000000000338     0 SECTION LOCAL  DEFAULT    2 \n     3: 0000000000000358     0 SECTION LOCAL  DEFAULT    3 \n     4: 000000000000037c     0 SECTION LOCAL  DEFAULT    4 \n     5: 00000000000003a0     0 SECTION LOCAL  DEFAULT    5 \n     6: 00000000000003c8     0 SECTION LOCAL  DEFAULT    6 \n     7: 0000000000000470     0 SECTION LOCAL  DEFAULT    7 \n     8: 00000000000004f2     0 SECTION LOCAL  DEFAULT    8 \n     9: 0000000000000500     0 SECTION LOCAL  DEFAULT    9 \n    10: 0000000000000520     0 SECTION LOCAL  DEFAULT   10 \n    11: 00000000000005e0     0 SECTION LOCAL  DEFAULT   11 \n    12: 0000000000001000     0 SECTION LOCAL  DEFAULT   12 \n    13: 0000000000001020     0 SECTION LOCAL  DEFAULT   13 \n    14: 0000000000001040     0 SECTION LOCAL  DEFAULT   14 \n    15: 0000000000001050     0 SECTION LOCAL  DEFAULT   15 \n    16: 0000000000001060     0 SECTION LOCAL  DEFAULT   16 \n    17: 00000000000011e8     0 SECTION LOCAL  DEFAULT   17 \n    18: 0000000000002000     0 SECTION LOCAL  DEFAULT   18 \n    19: 0000000000002014     0 SECTION LOCAL  DEFAULT   19 \n    20: 0000000000002058     0 SECTION LOCAL  DEFAULT   20 \n    21: 0000000000003db8     0 SECTION LOCAL  DEFAULT   21 \n    22: 0000000000003dc0     0 SECTION LOCAL  DEFAULT   22 \n    23: 0000000000003dc8     0 SECTION LOCAL  DEFAULT   23 \n    24: 0000000000003fb8     0 SECTION LOCAL  DEFAULT   24 \n    25: 0000000000004000     0 SECTION LOCAL  DEFAULT   25 \n    26: 0000000000004010     0 SECTION LOCAL  DEFAULT   26 \n    27: 0000000000000000     0 SECTION LOCAL  DEFAULT   27 \n    28: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c\n    29: 0000000000001090     0 FUNC    LOCAL  DEFAULT   16 deregister_tm_clones\n    30: 00000000000010c0     0 FUNC    LOCAL  DEFAULT   16 register_tm_clones\n    31: 0000000000001100     0 FUNC    LOCAL  DEFAULT   16 __do_global_dtors_aux\n    32: 0000000000004010     1 OBJECT  LOCAL  DEFAULT   26 completed.8061\n    33: 0000000000003dc0     0 OBJECT  LOCAL  DEFAULT   22 __do_global_dtors_aux_fin\n    34: 0000000000001140     0 FUNC    LOCAL  DEFAULT   16 frame_dummy\n    35: 0000000000003db8     0 OBJECT  LOCAL  DEFAULT   21 __frame_dummy_init_array_\n    36: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS hello.c\n    37: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c\n    38: 000000000000215c     0 OBJECT  LOCAL  DEFAULT   20 __FRAME_END__\n    39: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS \n    40: 0000000000003dc0     0 NOTYPE  LOCAL  DEFAULT   21 __init_array_end\n    41: 0000000000003dc8     0 OBJECT  LOCAL  DEFAULT   23 _DYNAMIC\n    42: 0000000000003db8     0 NOTYPE  LOCAL  DEFAULT   21 __init_array_start\n    43: 0000000000002014     0 NOTYPE  LOCAL  DEFAULT   19 __GNU_EH_FRAME_HDR\n    44: 0000000000003fb8     0 OBJECT  LOCAL  DEFAULT   24 _GLOBAL_OFFSET_TABLE_\n    45: 0000000000001000     0 FUNC    LOCAL  DEFAULT   12 _init\n    46: 00000000000011e0     5 FUNC    GLOBAL DEFAULT   16 __libc_csu_fini\n    47: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_deregisterTMCloneTab\n    48: 0000000000004000     0 NOTYPE  WEAK   DEFAULT   25 data_start\n    49: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND puts@@GLIBC_2.2.5\n    50: 0000000000004010     0 NOTYPE  GLOBAL DEFAULT   25 _edata\n    51: 00000000000011e8     0 FUNC    GLOBAL HIDDEN    17 _fini\n    52: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __libc_start_main@@GLIBC_\n    53: 0000000000004000     0 NOTYPE  GLOBAL DEFAULT   25 __data_start\n    54: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__\n    55: 0000000000004008     0 OBJECT  GLOBAL HIDDEN    25 __dso_handle\n    56: 0000000000002000     4 OBJECT  GLOBAL DEFAULT   18 _IO_stdin_used\n    57: 0000000000001170   101 FUNC    GLOBAL DEFAULT   16 __libc_csu_init\n    58: 0000000000004018     0 NOTYPE  GLOBAL DEFAULT   26 _end\n    59: 0000000000001060    47 FUNC    GLOBAL DEFAULT   16 _start\n    60: 0000000000004010     0 NOTYPE  GLOBAL DEFAULT   26 __bss_start\n    61: 0000000000001149    38 FUNC    GLOBAL DEFAULT   16 main\n    62: 0000000000004010     0 OBJECT  GLOBAL HIDDEN    25 __TMC_END__\n    63: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_registerTMCloneTable\n    64: 0000000000000000     0 FUNC    WEAK   DEFAULT  UND __cxa_finalize@@GLIBC_2.2\n<\/code><\/pre>\n\n\n\n<h2>\u56db\u3001\u53c2\u8003\u94fe\u63a5<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.cnblogs.com\/timothy020\/p\/18579740\">https:\/\/www.cnblogs.com\/timothy020\/p\/18579740<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/blog.csdn.net\/sweetfather\/article\/details\/147969081\">https:\/\/blog.csdn.net\/sweetfather\/article\/details\/147969081<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u7b80\u4ecb ELF\u4ee3\u8868Executable and Linkable Format\uff0c\u662f\u7c7bUnix\u5e73\u53f0\u6700\u901a\u7528\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f\uff0c\u5d4c\u5165\u5f0f\u8bbe\u5907\u5f88\u591a\u90fd\u662fLinux\u7cfb\u7edf\uff0c\u5b83\u91cc\u9762\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u5c31\u662fELF\u683c\u5f0f\uff0c\u5305\u542b\u4ee5\u4e0b\u4e09\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"_links":{"self":[{"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2328"}],"collection":[{"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=2328"}],"version-history":[{"count":15,"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2328\/revisions"}],"predecessor-version":[{"id":2347,"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/posts\/2328\/revisions\/2347"}],"wp:attachment":[{"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=2328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=2328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhiwanyuzhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=2328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}