<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>C&#43;&#43; - 標籤 - Yan-Hao Wang&#39;s Blog</title>
        <link>https://kola.ink/tags/c&#43;&#43;/</link>
        <description>C&#43;&#43; - 標籤 - Yan-Hao Wang&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-TW</language><managingEditor>bses30074@gmail.com (Yan-Hao Wang)</managingEditor>
            <webMaster>bses30074@gmail.com (Yan-Hao Wang)</webMaster><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Sun, 07 Jun 2026 22:00:52 &#43;0800</lastBuildDate><atom:link href="https://kola.ink/tags/c&#43;&#43;/" rel="self" type="application/rss+xml" /><item>
    <title>OS ABI 了解</title>
    <link>https://kola.ink/os-abi/</link>
    <pubDate>Sun, 07 Jun 2026 22:00:52 &#43;0800</pubDate>
    <author>bses30074@gmail.com (Yan-Hao Wang)</author>
    <guid>https://kola.ink/os-abi/</guid>
    <description><![CDATA[<h2 id="簡介">簡介</h2>
<p>常常說 ABI 是已經編譯好的程式和 OS 之間的介面規範，他規定的是 Binary 層級怎麼互動的。</p>
<p>根據 <a href="https://wiki.osdev.org/System_V_ABI" target="_blank" rel="noopener noreffer ">System V ABI</a>，像是：</p>
<ul>
<li>Calling Convention
<ul>
<li>函式參數放在 stack/register</li>
<li>Return value 放哪裡</li>
<li>Stack frame layout</li>
<li>CPU 執行函式只是跳到某個函式第一個 instruction，編譯器產生的機器碼負責把第一個參數放在 stack/register</li>
</ul>
</li>
<li>System Call Interface</li>
<li>直接定義 Bianry Format，System V ABI 使用 ELF</li>
<li>Dynamic Linking 的規則</li>
<li>資料類型的大小</li>
</ul>
<p>最常見的就是以 C 的 ABI，C++ ABI 則複雜一點。</p>]]></description>
</item>
</channel>
</rss>
