{"id":734,"date":"2021-12-10T00:44:53","date_gmt":"2021-12-09T16:44:53","guid":{"rendered":"https:\/\/blog.cauchyschwarz.com\/?p=734"},"modified":"2021-12-10T00:44:56","modified_gmt":"2021-12-09T16:44:56","slug":"linking","status":"publish","type":"post","link":"https:\/\/blog.cauchyschwarz.com\/?p=734","title":{"rendered":"Linking"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e0fc7bce149\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e0fc7bce149\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#C%E7%A8%8B%E5%BA%8F%E7%9A%84%E7%BC%96%E8%AF%91%E8%BF%87%E7%A8%8B\" >C\u7a0b\u5e8f\u7684\u7f16\u8bd1\u8fc7\u7a0b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E4%B8%A4%E7%A7%8D%E9%93%BE%E6%8E%A5%E6%96%B9%E5%BC%8F\" >\u4e24\u79cd\u94fe\u63a5\u65b9\u5f0f<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E9%9D%99%E6%80%81%E9%93%BE%E6%8E%A5Static_Linking\" >\u9759\u6001\u94fe\u63a5(Static Linking)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5Dynamic_Linking\" >\u52a8\u6001\u94fe\u63a5(Dynamic Linking)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E4%B8%89%E7%A7%8D%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\" >\u4e09\u79cd\u76ee\u6807\u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E9%93%BE%E6%8E%A5%E5%8F%91%E7%94%9F%E7%9A%84%E6%97%B6%E6%9C%BA\" >\u94fe\u63a5\u53d1\u751f\u7684\u65f6\u673a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E7%AC%A6%E5%8F%B7%E5%92%8C%E7%AC%A6%E5%8F%B7%E8%A1%A8\" >\u7b26\u53f7\u548c\u7b26\u53f7\u8868<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E7%AC%A6%E5%8F%B7%E8%A7%A3%E6%9E%90\" >\u7b26\u53f7\u89e3\u6790<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E9%93%BE%E6%8E%A5%E5%99%A8%E5%A6%82%E4%BD%95%E8%A7%A3%E6%9E%90%E8%A2%AB%E5%AE%9A%E4%B9%89%E4%BA%86%E5%A4%9A%E6%AC%A1%E7%9A%84%E5%85%A8%E5%B1%80%E7%AC%A6%E5%8F%B7\" >\u94fe\u63a5\u5668\u5982\u4f55\u89e3\u6790\u88ab\u5b9a\u4e49\u4e86\u591a\u6b21\u7684\u5168\u5c40\u7b26\u53f7<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E4%BD%BF%E7%94%A8%E9%9D%99%E6%80%81%E5%BA%93\" >\u4f7f\u7528\u9759\u6001\u5e93<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E9%87%8D%E5%AE%9A%E4%BD%8DRelocation\" >\u91cd\u5b9a\u4f4d(Relocation)<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#Relocation_Entries\" >Relocation Entries<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#Relocating_Symbol_References\" >Relocating Symbol References<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\" >\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#%E8%BD%BD%E5%85%A5%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\" >\u8f7d\u5165\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=734\/#Linux%E4%B8%8B%E7%94%A8%E4%BA%8E%E5%A4%84%E7%90%86%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6%E7%9A%84%E7%A8%8B%E5%BA%8F\" >Linux\u4e0b\u7528\u4e8e\u5904\u7406\u76ee\u6807\u6587\u4ef6\u7684\u7a0b\u5e8f<\/a><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\" id=\"c%E7%A8%8B%E5%BA%8F%E7%9A%84%E7%BC%96%E8%AF%91%E8%BF%87%E7%A8%8B\"><span class=\"ez-toc-section\" id=\"C%E7%A8%8B%E5%BA%8F%E7%9A%84%E7%BC%96%E8%AF%91%E8%BF%87%E7%A8%8B\"><\/span>C\u7a0b\u5e8f\u7684\u7f16\u8bd1\u8fc7\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<ol class=\"wp-block-list\"><li>\u9884\u5904\u7406<code>cpp [other arguments] main.c \/tmp\/main.i<\/code><\/li><li>\u7f16\u8bd1<code>cc1 \/tmp\/main.i main.c -O2 [other arguments] -o \/tmp\/main.s<\/code><\/li><li>\u6c47\u7f16<code>as [other arguments] -o \/tmp\/main.o \/tmp\/main.s<\/code><\/li><li>\u94fe\u63a5<code>ld -o p [system object files and args] \/tmp\/main.o \/tmp\/swap.o<\/code><\/li><\/ol>\n\n\n\n<p>\u5728\u7528gcc\u7f16\u8bd1\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u7528<code>-v<\/code>\u9009\u9879\u6253\u5370\u51fagcc\u5728\u6574\u4e2a\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u6240\u4f7f\u7528\u7684\u5177\u4f53\u547d\u4ee4\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>-v Print (on standard error output) the commands executed to run the stages of compilation. Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.<\/p><\/blockquote>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E4%B8%A4%E7%A7%8D%E9%93%BE%E6%8E%A5%E6%96%B9%E5%BC%8F\"><span class=\"ez-toc-section\" id=\"%E4%B8%A4%E7%A7%8D%E9%93%BE%E6%8E%A5%E6%96%B9%E5%BC%8F\"><\/span>\u4e24\u79cd\u94fe\u63a5\u65b9\u5f0f<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E9%9D%99%E6%80%81%E9%93%BE%E6%8E%A5static-linking\"><span class=\"ez-toc-section\" id=\"%E9%9D%99%E6%80%81%E9%93%BE%E6%8E%A5Static_Linking\"><\/span>\u9759\u6001\u94fe\u63a5(Static Linking)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u9759\u6001\u94fe\u63a5\u9700\u8981\u5b8c\u6210\u7684\u4efb\u52a1\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Symbol resolution<\/strong>&nbsp;\u8ba9\u6240\u6709\u7684\u7b26\u53f7\u5f15\u7528\u6307\u5411\u552f\u4e00\u7684\u7b26\u53f7\u5b9a\u4e49<\/li><li><strong>Relocation<\/strong>&nbsp;<s>\u7f16\u8bd1\u5668\u548c\u6c47\u7f16\u5668\u4ea7\u751f\u7684\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6\u7684\u4ee3\u7801\u6bb5\u548c\u6570\u636e\u6bb5\u7684\u5730\u5740\u90fd\u662f\u4ece0\u5f00\u59cb\u7684\uff0c\u9759\u6001\u94fe\u63a5\u901a\u8fc7\u4e3a\u7b26\u53f7\u5b9a\u4e49\u6307\u5b9a\u5185\u5b58\u5730\u5740\u6765\u91cd\u65b0\u5b9a\u4f4d\u8fd9\u4e9b\u6bb5(relocate)\uff0c\u7136\u540e\u4fee\u6539\u6240\u6709\u7684\u7b26\u53f7\u5f15\u7528\u8ba9\u5b83\u4eec\u80fd\u591f\u6307\u5411\u6b63\u786e\u7684\u5185\u5b58\u5730\u5740\u3002<\/s><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5dynamic-linking\"><span class=\"ez-toc-section\" id=\"%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5Dynamic_Linking\"><\/span>\u52a8\u6001\u94fe\u63a5(Dynamic Linking)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E4%B8%89%E7%A7%8D%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\"><span class=\"ez-toc-section\" id=\"%E4%B8%89%E7%A7%8D%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\"><\/span>\u4e09\u79cd\u76ee\u6807\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Relocatable object file<\/strong>\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6\u7ec4\u6210\u63cf\u8ff0ELF header\u94fe\u63a5\u5668\u901a\u8fc7ELF header\u6765\u89e3\u6790\u6b64\u76ee\u6807\u6587\u4ef6\u3002\u524d16\u4e2a\u5b57\u8282\u63cf\u8ff0word size\u548c\u5b57\u8282\u5e8f\u3002\u5269\u4e0b\u90e8\u5206\u5305\u542b\u7684\u4fe1\u606f\u6709\uff1aELF header\u81ea\u8eab\u7684\u957f\u5ea6\u3001\u76ee\u6807\u6587\u4ef6\u7c7b\u578b(relocatable\/executable\/shared)\u3001\u76ee\u6807\u673a\u5668\u7c7b\u578b(e.g.\uff0cIA32)\u3001section header table\u7684\u6587\u4ef6\u504f\u79fb\u91cf\uff0csection header table\u4e2d\u6bcf\u4e2a\u6761\u76ee\u7684\u957f\u5ea6\u548c\u6761\u76ee\u7684\u6570\u76ee\u3002.text\u673a\u5668\u7801.rodata\u53ea\u8bfb\u6570\u636e.data\u521d\u59cb\u5316\u4e86\u7684C\u5168\u5c40\u53d8\u91cf.bss\u672a\u521d\u59cb\u5316\u7684C\u5168\u5c40\u53d8\u91cf\u3002\u7531\u4e8e\u662f<strong>\u672a\u521d\u59cb\u5316\u7684<\/strong>\uff0c\u6240\u4ee5\u5b9e\u9645\u4e0d\u5360\u7528\u786c\u76d8\u7a7a\u95f4\u3002\u540d\u5b57\u7684\u7531\u6765\uff1aBlock Storage Start\uff0c\u53ef\u4ee5\u7406\u89e3\u4e3aBetter Save Space\u6765\u65b9\u4fbf\u8bb0\u5fc6.symtab\u51fd\u6570\u548c\u5168\u5c40\u53d8\u91cf\u7684\u7b26\u53f7\u8868(symbol table)\uff0c\u6b64\u7b26\u53f7\u8868\u4e0d\u5305\u542b\u5c40\u90e8\u53d8\u91cf.rel.text\u5305\u542b\u4e00\u4e2a.text\u6bb5\u4e2d\u5728\u94fe\u63a5\u65f6\u9700\u8981\u4fee\u6539\u7684\u5730\u65b9\u7684\u5217\u8868\u3002\u4e00\u822c\u53ea\u8981\u662f\u8c03\u7528\u4e86\u5916\u90e8\u51fd\u6570\u6216\u8005\u4f7f\u7528\u4e86\u5168\u5c40\u53d8\u91cf\u7684\u5730\u65b9\u90fd\u9700\u8981\u5728\u94fe\u63a5\u65f6\u8fdb\u884c\u4fee\u6539\u3002\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u8fd9\u4e2a\u6bb5\u662f\u4e0d\u9700\u8981\u7684\u3002.rel.data<s>\u5728\u6b64\u76ee\u6807\u6587\u4ef6\u4e2d\u88ab\u5f15\u7528\u6216\u5b9a\u4e49\u7684\u5168\u5c40\u53d8\u91cf\u7684\u91cd\u5b9a\u4f4d\u4fe1\u606f\u3002<\/s>.debug\u5305\u542b\u4e00\u4e2a\u7528\u4e8e\u8c03\u8bd5\u7684\u7b26\u53f7\u8868(\u5c40\u90e8\u53d8\u91cf\u3001typedef\u7b49\u7b49)\uff0c\u7f16\u8bd1\u65f6\u6307\u5b9a<code>-g<\/code>\u9009\u9879\u4f1a\u751f\u6210.debug\u6bb5.line\u5305\u542b.text\u6bb5\u4e2d\u673a\u5668\u6307\u4ee4\u4e0e\u6e90\u7a0b\u5e8f\u884c\u6570\u7684\u5bf9\u5e94\u5173\u7cfb.strtab\u4e00\u4e2a\u5b57\u7b26\u4e32\u8868(null-terminated character strings)\uff0c\u4e3a.symtab\u6bb5\u548c.debug\u6bb5\u4e2d\u7684\u7b26\u53f7\u8868\u6240\u5f15\u7528Section header table\u5305\u542b\u4e86\u63cf\u8ff0\u4ece.text\u6bb5\u5230.strtab\u6bb5\u6bcf\u4e00\u6bb5\u7684\u4f4d\u7f6e\u548c\u5927\u5c0f\u7684\u6761\u76ee\uff0c\u6bcf\u4e2a\u6761\u76ee\u7684\u5927\u5c0f\u662f\u56fa\u5b9a\u7684<\/li><li><strong>Executable object file<\/strong>\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6\u683c\u5f0f\u8fd0\u884c\u8be5\u683c\u5f0f\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6\u7684\u7cfb\u7edfa.out\u65e9\u671fUnix\u7cfb\u7edfCommon Object File Format(COFF)\u65e9\u671fSystem V UnixPortable Executable(PE)\uff0cCOFF\u7684\u53d8\u79cdWindows NTUnix Executable and Linkable Format(ELF)\u73b0\u4ee3Unix\u7cfb\u7edf\uff0c\u5982Linux\u3001\u540e\u671f\u7684System V Unix\uff0cBSD Unix\u548cSun Solaris<\/li><li><strong>Shared object file<\/strong><\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E9%93%BE%E6%8E%A5%E5%8F%91%E7%94%9F%E7%9A%84%E6%97%B6%E6%9C%BA\"><span class=\"ez-toc-section\" id=\"%E9%93%BE%E6%8E%A5%E5%8F%91%E7%94%9F%E7%9A%84%E6%97%B6%E6%9C%BA\"><\/span>\u94fe\u63a5\u53d1\u751f\u7684\u65f6\u673a<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E7%AC%A6%E5%8F%B7%E5%92%8C%E7%AC%A6%E5%8F%B7%E8%A1%A8\"><span class=\"ez-toc-section\" id=\"%E7%AC%A6%E5%8F%B7%E5%92%8C%E7%AC%A6%E5%8F%B7%E8%A1%A8\"><\/span>\u7b26\u53f7\u548c\u7b26\u53f7\u8868<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u5bf9\u4e8e\u94fe\u63a5\u5668\uff0c\u6709\u4e09\u79cd\u4e0d\u540c\u7684\u7b26\u53f7\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5168\u5c40\u7b26\u53f7(Global symbols) \u5728\u6a21\u5757m\u5b9a\u4e49\u4e14\u53ef\u4ee5\u88ab\u5176\u4ed6\u6a21\u5757\u5f15\u7528\u7684\u5168\u5c40\u7b26\u53f7<\/li><li>\u5916\u90e8\u7b26\u53f7(External symbols) \u88ab\u6a21\u5757m\u5f15\u7528\u4f46\u662f\u5728\u5176\u4ed6\u6a21\u5757\u5b9a\u4e49\u7684\u5168\u5c40\u7b26\u53f7<\/li><li>\u672c\u5730\u7b26\u53f7(Local symbols)\uff1a \u6a21\u5757m\u5b9a\u4e49\u4e14\u53ea\u80fd\u88ab\u6a21\u5757m\u81ea\u5df1\u4f7f\u7528\u7684\u7b26\u53f7 \u8fd9\u91cc\u7684Local\u4e0d\u662flocal variable\u7684local\uff0c\u800c\u662f\u6307static\u3002\u4e00\u822c\u7684\u5c40\u90e8\u53d8\u91cf\u662f\u548c\u7b26\u53f7\u8868\u6ca1\u6709\u5173\u7cfb\u7684\uff0c\u4ed6\u4eec\u7531\u6808\u5904\u7406\uff0c\u4f46\u662f\u5982\u679c\u662f\u9759\u6001(static)\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u90a3\u4e48\u8be5\u53d8\u91cf\u5c31\u548c\u5168\u5c40\u53d8\u91cf\u4e00\u6837\u5904\u7406\u3002<\/li><\/ul>\n\n\n\n<p>.symtab\u6bb5\u4e2d\u7684ELF\u7b26\u53f7\u8868\u4e2d\u7684\u6bcf\u4e2a\u6761\u76ee\u7684\u7c7b\u578b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">typedef struct {\n\tint name;\t\t<em>\/* String table offset *\/<\/em>\n\tint value;\t\t<em>\/* Section offset, or VM address *\/<\/em>\n\tint size;\t\t<em>\/* Object size in bytes *\/<\/em>\n\tchar type:4,\t\t<em>\/* Data, func, section, or src file name (4 bits) *\/<\/em>\n\t\tbinding:4;\t<em>\/* Local or global (4 bits) *\/<\/em>\n\tchar reserved;\t\t<em>\/* Unused *\/<\/em>\n\tchar section;\t\t<em>\/* Section header index, ABS, UNDEF, or COMMON *\/<\/em>\n} Elf_Symbol;\n<\/code><\/pre>\n\n\n\n<p>\u5404\u5b57\u6bb5\u5177\u4f53\u542b\u4e49\u53c2\u8003csapp\u7684\u7535\u5b50\u7248(\u7b2c2\u7248)661\u9875\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E7%AC%A6%E5%8F%B7%E8%A7%A3%E6%9E%90\"><span class=\"ez-toc-section\" id=\"%E7%AC%A6%E5%8F%B7%E8%A7%A3%E6%9E%90\"><\/span>\u7b26\u53f7\u89e3\u6790<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E9%93%BE%E6%8E%A5%E5%99%A8%E5%A6%82%E4%BD%95%E8%A7%A3%E6%9E%90%E8%A2%AB%E5%AE%9A%E4%B9%89%E4%BA%86%E5%A4%9A%E6%AC%A1%E7%9A%84%E5%85%A8%E5%B1%80%E7%AC%A6%E5%8F%B7\"><span class=\"ez-toc-section\" id=\"%E9%93%BE%E6%8E%A5%E5%99%A8%E5%A6%82%E4%BD%95%E8%A7%A3%E6%9E%90%E8%A2%AB%E5%AE%9A%E4%B9%89%E4%BA%86%E5%A4%9A%E6%AC%A1%E7%9A%84%E5%85%A8%E5%B1%80%E7%AC%A6%E5%8F%B7\"><\/span>\u94fe\u63a5\u5668\u5982\u4f55\u89e3\u6790\u88ab\u5b9a\u4e49\u4e86\u591a\u6b21\u7684\u5168\u5c40\u7b26\u53f7<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>strong symbol \u51fd\u6570\u548c\u521d\u59cb\u5316\u4e86\u7684\u5168\u5c40\u53d8\u91cf\u662fstrong symbol<\/li><li>weak symbol \u672a\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf<\/li><\/ul>\n\n\n\n<p>\u89e3\u6790\u89c4\u5219\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u4e0d\u5141\u8bb8\u5b58\u5728\u591a\u4e2astrong symbol<\/li><li>\u6709\u4e00\u4e2astrong symbol\u548c\u591a\u4e2aweak symbol\uff0c\u53d6strong symbol<\/li><li>\u6709\u591a\u4e2aweak symbol\uff0c\u4efb\u610f\u53d6\u4e00\u4e2a<\/li><\/ol>\n\n\n\n<p><em>csapp<\/em>\u4e3e\u4e86\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\"><em>\/* foo5.c *\/<\/em>\n#include &lt;stdio.h&gt;\nvoid f(void);\n\nint x = 15213;\nint y = 15212;\n\nint main() {\n    f();\n    printf(\"x = 0x%x y = 0x%x \\n\", x, y);\n    return 0;\n}\n\n<em>\/* bar5.c *\/<\/em>\ndouble x;\n\nvoid f() {\n    x = -0.0;\n}\n<\/code><\/pre>\n\n\n\n<p>\u7f16\u8bd1\u6267\u884c\u4f1a\u4ea7\u751f\u4ee5\u4e0b\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">linux&gt; gcc -o foobar5 foo5.c bar5.c\nlinux&gt; .\/foobar5\nx = 0x0 y = 0x80000000\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%BD%BF%E7%94%A8%E9%9D%99%E6%80%81%E5%BA%93\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E9%9D%99%E6%80%81%E5%BA%93\"><\/span>\u4f7f\u7528\u9759\u6001\u5e93<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>\u9759\u6001\u5e93 \u5c06\u6307\u5b9a\u7684(\u591a\u4e2a)\u51fd\u6570\u7ed9\u5206\u522b\u7f16\u8bd1\u6210\u76ee\u6807\u6587\u4ef6\uff0c\u7136\u540e\u6253\u5305\u6210\u4e00\u4e2a\u6240\u8c13\u7684\u9759\u6001\u5e93\u6587\u4ef6\u3002<br>\u5728\u7f16\u8bd1\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u6307\u5b9a\u8981\u94fe\u63a5\u7684\u9759\u6001\u5e93\u6587\u4ef6\uff0c\u94fe\u63a5\u5668\u4f1a\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u7684\u9700\u8981\uff0c\u53ea\u62f7\u8d1d\u5e94\u7528\u7a0b\u5e8f\u6240\u9700\u8981\u7684\u6a21\u5757\u5230\u6700\u7ec8\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u4e2d\u3002<\/li><li>\u521b\u5efa\u9759\u6001\u5e93<br><code>gcc -c addvec.c multvec.c <\/code><br><code>ar rcs libvector.a addvec.o multvec.o <\/code><br>\u5373\u5148\u751f\u6210\u53ef\u91cd\u5b9a\u4f4d\u76ee\u6807\u6587\u4ef6\uff0c\u7136\u540e\u6253\u5305\u6210\u9759\u6001\u5e93\u3002<\/li><li>\u4f7f\u7528\u9759\u6001\u5e93<ul><li><code>--static<\/code>\u9009\u9879 \u52a0\u4e86<code>--static<\/code>\u9009\u9879\u65f6\uff0c\u94fe\u63a5\u5668\u4f1a\u5c06\u76f8\u5e94\u7684\u6a21\u5757\u62f7\u8d1d\u5230\u6700\u7ec8\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u4e2d\uff0c\u5728\u8f7d\u5165\u65f6\u4e0d\u518d\u9700\u8981\u4efb\u4f55\u94fe\u63a5\u64cd\u4f5c\u3002\u4e0d\u52a0<code>--static<\/code>\u9009\u9879\uff0c\u8f7d\u5165\u65f6\u4ecd\u7136\u4f1a\u9700\u8981\u94fe\u63a5\u64cd\u4f5c\u3002<\/li><li>\u5173\u4e8e\u9759\u6001\u5e93\u94fe\u63a5\u7684\u987a\u5e8f \u5982\u679c\u4e00\u4e2a\u53ef\u91cd\u5165\u76ee\u6807\u6587\u4ef6\u6216\u8fd9\u9759\u6001\u5e93a\u5f15\u7528\u4e86\u53e6\u4e00\u4e2a\u9759\u6001\u5e93\u91cc\u9762\u7684\u67d0\u4e2a\u6a21\u5757b\uff0c\u90a3\u4e48\u5728\u94fe\u63a5\u5668\u7684\u53c2\u6570\u5217\u8868\u91cc\uff0cb\u5e94\u8be5\u653e\u5728a\u7684\u540e\u9762\u3002\u5177\u4f53\u7b97\u6cd5\u53c2\u8003<em>csapp<\/em>\u7535\u5b50\u7248(\u7b2c\u4e8c\u7248)670\u9875\u3002<br>\u540c\u4e00\u4e2a\u9759\u6001\u5e93\u6216\u8005\u53ef\u91cd\u5165\u76ee\u6807\u6587\u4ef6\u53ef\u4ee5\u5728\u94fe\u63a5\u5668\u7684\u53c2\u6570\u5217\u8868\u91cc\u51fa\u73b0\u591a\u6b21\uff0c\u4ee5\u6ee1\u8db3\u9759\u6001\u5e93\u94fe\u63a5\u7684\u987a\u5e8f\u8981\u6c42\u3002<\/li><\/ul><\/li><\/ol>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E9%87%8D%E5%AE%9A%E4%BD%8Drelocation\"><span class=\"ez-toc-section\" id=\"%E9%87%8D%E5%AE%9A%E4%BD%8DRelocation\"><\/span>\u91cd\u5b9a\u4f4d(Relocation)<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u5728\u5b8c\u6210\u7b26\u53f7\u89e3\u6790\u4e4b\u540e\uff0c\u94fe\u63a5\u5668\u9700\u8981\u5c06\u8f93\u5165\u7684\u76ee\u6807\u6587\u4ef6\u7ed9\u5408\u5e76\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u4e14\u4e3a\u6bcf\u4e2a\u7b26\u53f7\u6307\u5b9a\u8fd0\u884c\u65f6\u7684\u5185\u5b58\u5730\u5740\u3002\u91cd\u5b9a\u4f4d(Relocation)\u5305\u62ec\u4e24\u4e2a\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>Relocating sections and symbol definitions<\/em>&nbsp;\u628a\u4e0d\u540c\u8f93\u5165\u76ee\u6807\u6587\u4ef6\u7684\u540c\u4e00\u7c7b\u578b\u7684\u6bb5\u7ed9\u5408\u5e76\u4e3a\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6\u7684\u8be5\u7c7b\u578b\u7684\u6bb5\uff0c\u4e14\u6307\u5b9a\u8fd0\u884c\u65f6\u7684\u5185\u5b58\u5730\u5740\u3002<\/li><li><em>Relocating symbol references within sections<\/em>&nbsp;\u91cd\u5b9a\u4f4d\u7b26\u53f7\u5f15\u7528<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"relocation-entries\"><span class=\"ez-toc-section\" id=\"Relocation_Entries\"><\/span>Relocation Entries<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u6c47\u7f16\u5668\u751f\u6210\u76ee\u6807\u6587\u4ef6\u65f6\uff0c\u5982\u679c\u6c47\u7f16\u5668\u4e0d\u77e5\u9053\u67d0\u4e2a\u7b26\u53f7\u7a76\u7adf\u4f1a\u88ab\u653e\u5728\u5185\u5b58\u7684\u54ea\u4e2a\u5730\u65b9\uff0c\u6c47\u7f16\u5668\u5c31\u4f1a\u751f\u6210\u4e00\u4e2arelocationentry\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">typedef struct {\n\tint offset;\t\t<em>\/* Offset of the reference to relocate *\/<\/em>\n\tint symbol:24,\t\t<em>\/* Symbol the reference should point to *\/<\/em>\n\t    type:8;\t\t<em>\/* Relocation type *\/<\/em>\n} Elf32_Rel;\n\n<\/code><\/pre>\n\n\n\n<p>ELF\u6587\u4ef6\u683c\u5f0f\u5b9a\u4e49\u4e8611\u79cd\u91cd\u5b9a\u4f4d\u7c7b\u578b;\u5176\u4e2d\u6700\u57fa\u672c\u7684\u4e24\u79cd\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>R_386_PC32<\/em>&nbsp;\u4f7f\u7528PC-relative address(PC\uff0c\u5373program counter\uff0c\u4e0b\u4e00\u6761\u6307\u4ee4\u7684\u5730\u5740)\u3002<\/li><li><em>R_386_32<\/em>&nbsp;\u4f7f\u752832\u4f4d\u7edd\u5bf9\u5730\u5740<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"relocating-symbol-references\"><span class=\"ez-toc-section\" id=\"Relocating_Symbol_References\"><\/span>Relocating Symbol References<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">foreach section s {\n\tforeach relocation entry r {\n\t\trefptr = s + r.offset;\t<em>\/* ptr to reference to be relocated *\/<\/em>\n\n\t\t<em>\/* Relocate a PC-relative reference *\/<\/em>\n\t\tif (r.type == R_386_PC32) {\n\t\t\trefaddr = ADDR(s) + r.offset;\t<em>\/* ref's runtime address *\/<\/em>\n\t\t\t*refptr = (unsigned) (ADDR(r.symbol) + *refptr - refaddr);\n\t\t}\n\n\t\t<em>\/* Relocate an absolute reference *\/<\/em>\n\t\tif (r.type == R_386_32)\n\t\t\t*refptr = (unsigned) (ADDR(r.symbol) + *refptr);\n\t}\n}\n<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\"><span class=\"ez-toc-section\" id=\"%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\"><\/span>\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u4f5c\u7528<\/th><th>\u6bb5\u540d\u79f0<\/th><th>\u5c5e\u6027<\/th><\/tr><\/thead><tbody><tr><td>\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5f00\u59cb\uff0c\u63cf\u8ff0\u6574\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u6574\u4f53\u683c\u5f0f\u4ee5\u53ca\u5305\u542b\u4e86\u7a0b\u5e8f\u7684\u5165\u53e3(<em>entry point<\/em>)<\/td><td>ELF header<\/td><td>\u53ea\u8bfb(code segment\u7684\u4e00\u90e8\u5206)<\/td><\/tr><tr><td>\u63cf\u8ff0\u5982\u4f55\u5c06\u6b64\u53ef\u6267\u884c\u7a0b\u5e8f\u8f7d\u5165\u5230\u5185\u5b58\u4e2d\u8fd0\u884c\uff0c\u53ef\u4ee5\u901a\u8fc7<code>objdump<\/code>\u547d\u4ee4\u67e5\u770b\u5230\u6b64\u90e8\u5206\u7684\u5185\u5bb9<\/td><td>Segment header table<\/td><td><\/td><\/tr><tr><td>\u5b9a\u4e49\u4e00\u4e2a\u540d\u4e3a*_init*\u7684\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u88ab\u7a0b\u5e8f\u7684\u521d\u59cb\u5316\u4ee3\u7801\u6267\u884c<\/td><td>.init<\/td><td>\u540c\u4e0a<\/td><\/tr><tr><td><\/td><td>.rodata<\/td><td>\u540c\u4e0a<\/td><\/tr><tr><td><\/td><td>.data<\/td><td>\u53ef\u8bfb\u3001\u53ef\u5199(data segment\u7684\u4e00\u90e8\u5206)<\/td><\/tr><tr><td><\/td><td>.bss<\/td><td>\u540c\u4e0a<\/td><\/tr><tr><td><\/td><td>.symtab<\/td><td>\u4e0d\u8f7d\u5165\u5185\u5b58<\/td><\/tr><tr><td><\/td><td>.debug<\/td><td>\u540c\u4e0a<\/td><\/tr><tr><td><\/td><td>.line<\/td><td>\u540c\u4e0a<\/td><\/tr><tr><td><\/td><td>.strtab<\/td><td>\u540c\u4e0a<\/td><\/tr><tr><td>\u63cf\u8ff0\u76ee\u6807\u6587\u4ef6\u7684\u5404\u4e2a\u6bb5(Describes object file sections)<\/td><td>Section header table<\/td><td>\u540c\u4e0a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4e0b\u9762\u4fbf\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u7684Segment header table\u793a\u4f8b(\u7ecf\u8fc7<code>objdump<\/code>\u7684)\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Read-only code segment\nLOAD off\t0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12\n\tfilesz 0x00000448 memsz 0x00000448 flags r-x\n\nRead\/write data segment\nLOAD off\t0x00000448 vaddr 0x08049448 paddr 0x08049448 align 2**12\n\tfilesz 0x000000e8 memsz 0x00000104 flags rw-\n<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"%E8%BD%BD%E5%85%A5%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\"><span class=\"ez-toc-section\" id=\"%E8%BD%BD%E5%85%A5%E5%8F%AF%E6%89%A7%E8%A1%8C%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6\"><\/span>\u8f7d\u5165\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u6267\u884c\u7a0b\u5e8f\u7684\u65f6\u5019(\u901a\u8fc7<em>execve<\/em>\u51fd\u6570)\uff0c\u88c5\u8f7d\u5668(loader)\u4f1a\u628a\u53ef\u6267\u884c\u76ee\u6807\u6587\u4ef6\u7684\u4ee3\u7801\u548c\u6570\u636e\u62f7\u8d1d\u5230\u5185\u5b58\uff0c\u7136\u540e\u8df3\u8f6c\u5230\u8be5\u7a0b\u5e8f\u7684\u5f00\u59cb(<em>entry point<\/em>)\u3002\u8fd9\u4e2a\u62f7\u8d1d\u548c\u8df3\u8f6c\u7684\u8fc7\u7a0b\u5c31\u662f\u6240\u8c13\u7684\u88c5\u8f7d(loading)\u3002<br>\u4e0b\u56fe\u662f\u4e00\u4e2a\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6\u7684\u5185\u5b58\u753b\u50cf\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"424\" height=\"394\" src=\"https:\/\/blog.cauchyschwarz.com\/wp-content\/uploads\/2021\/12\/linux-runtime-memory-image.png\" alt=\"\" class=\"wp-image-735\" srcset=\"https:\/\/blog.cauchyschwarz.com\/wp-content\/uploads\/2021\/12\/linux-runtime-memory-image.png 424w, https:\/\/blog.cauchyschwarz.com\/wp-content\/uploads\/2021\/12\/linux-runtime-memory-image-300x279.png 300w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"linux%E4%B8%8B%E7%94%A8%E4%BA%8E%E5%A4%84%E7%90%86%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6%E7%9A%84%E7%A8%8B%E5%BA%8F\"><span class=\"ez-toc-section\" id=\"Linux%E4%B8%8B%E7%94%A8%E4%BA%8E%E5%A4%84%E7%90%86%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6%E7%9A%84%E7%A8%8B%E5%BA%8F\"><\/span>Linux\u4e0b\u7528\u4e8e\u5904\u7406\u76ee\u6807\u6587\u4ef6\u7684\u7a0b\u5e8f<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u7a0b\u5e8f\u540d<\/th><th>\u529f\u80fd<\/th><\/tr><\/thead><tbody><tr><td>ar<\/td><td>\u521b\u5efa\u9759\u6001\u5e93\uff0c\u4ee5\u53ca\u63d2\u5165\u3001\u5220\u9664\u3001\u5217\u51fa\u548c\u63d0\u53d6\u6210\u5458<\/td><\/tr><tr><td>strings<\/td><td>\u5217\u51fa\u76ee\u6807\u6587\u4ef6\u4e2d\u53ef\u6253\u5370\u7684\u5b57\u7b26\u4e32<\/td><\/tr><tr><td>strip<\/td><td>\u5220\u9664\u76ee\u6807\u6587\u4ef6\u4e2d\u7684\u7b26\u53f7\u8868<\/td><\/tr><tr><td>nm<\/td><td>\u5217\u51fa\u76ee\u6807\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u7b26\u53f7<\/td><\/tr><tr><td>size<\/td><td>\u5217\u51fa\u76ee\u6807\u6587\u4ef6\u7684\u5404\u4e2a\u6bb5\u7684\u540d\u79f0\u548c\u5927\u5c0f<\/td><\/tr><tr><td>readelf<\/td><td>\u663e\u793a\u76ee\u6807\u6587\u4ef6\u7684\u5b8c\u6574\u7ed3\u6784<\/td><\/tr><tr><td>objdump<\/td><td>\u6240\u6709\u6b64\u7c7b\u578b\u7684\u7a0b\u5e8f\u7684\u6e90\u5934<\/td><\/tr><tr><td>ldd<\/td><td>\u5217\u51fa\u53ef\u6267\u884c\u6587\u4ef6\u5728\u8fd0\u884c\u65f6\u9700\u8981\u7684\u52a8\u6001\u5e93<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>C\u7a0b\u5e8f\u7684\u7f16\u8bd1\u8fc7\u7a0b \u9884\u5904\u7406cpp [other arguments] main.c \/tmp\/main.i \u7f16\u8bd1cc1 \/tmp\/main.i main.c -O2 [other arguments] &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[77],"class_list":["post-734","post","type-post","status-publish","format-standard","hentry","category-10","tag-operatingsystem"],"_links":{"self":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=734"}],"version-history":[{"count":1,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/734\/revisions"}],"predecessor-version":[{"id":736,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/734\/revisions\/736"}],"wp:attachment":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}