• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理
            https://blog.csdn.net/giantpoplar/article/details/46485649


            首先,原文地址如下:

            http://www.quora.com/Systems-Programming/What-is-the-exact-difference-between-Dynamic-loading-and-dynamic-linking

            翻譯內容如下:

            動態裝入(Dynamic loading) 指的是當一個進程啟動后,將一個可執行的文件(原文是executable,我理解為磁盤上的文件 或者駐留在內存中的例程)或庫映射到(或者不常發生的復制)到進程內存空間。動態鏈接 (dynamic linking)指的是在編譯(匯編)之后,分解字符(resolving symbols)——把名字和地址或者偏移量聯系起來。這兩者難以區分的原因是,大約在進程啟動后,編譯(匯編)之后這兩個過程,通常對二者的微妙區別不加區分地一起完成。大概最清晰的方式來解釋這二者的區別就是分別展示二者的各種組合在實踐中意味著什么。

            動態裝入,靜態鏈接。

            可執行的文件擁有一個在編譯時生成的 地址/偏移量表,但是實際的代碼/數據在進程剛啟動時沒有裝到內存中。這并不是大多數現在的操作系統的處理方式,但是它可能描述了一些老式的overlay systems.如果現在的嵌入式系統也使用這種方式,我一點也不感覺到奇怪。無論是哪種情況,其目的都是給予程序員內存控制的自由同時避免運行時的鏈接花費。

            靜態裝入,動態鏈接

            這通常是在編譯時確定動態庫的工作方式。可執行文件包含動態/共享庫的引用,但是字符表(symbol table)沒有或者不完整。裝入和鏈接都在進程啟動時進行,被認為是“動態的”鏈接但不是“動態的”裝入。

            動態裝入,動態鏈接

            這是你調用dlopen或其他系統里的等價調用的時候發生的事情。object(.obj)文件在程序的控制下動態裝入(也就是開始之后),包括調用程序和庫里的字符都根據那個時刻進程的可能獨一無二的內存布局進行解析(把名字和地址/偏移量聯系起來).

            靜態裝入,靜態鏈接

            所有的東西都在編譯時解析完成。進程開始的時候所有東西都立即加載到內存中,不需要其他的解析(鏈接linking)。概括地說,加載發生自單個文件是不必要的,但是我認為實際的格式或者實現并不能夠在不使用動態鏈接的情況下實現多文件的裝入。


            原文內容如下

            Dynamic loading refers to mapping (or less often copying) an executable or library into a process's memory after is has started.  Dynamic linking refers to resolving symbols - associating their names with addresses or offsets - after compile time.  The reason it's hard to make a distinction is that the two are often done together without recognizing the subtle distinctions around the parts I put in bold.  Perhaps the clearest way to explain is to go through what the different combinations would mean in practice.

            • Dynamic loading, static linking.  The executable has an address/offset table generated at compile time, but the actual code/data aren't loaded into memory at process start.  This is not the way things tend to work in most systems nowadays, but it would describe some old-fashioned overlay systems.  I'd also be utterly unsurprised if some current embedded systems work this way too.  In either case, the goal is to give the programmer control over memory use while also avoiding the overhead of linking at runtime.
            • Static loading, dynamic linking.  This is how dynamic libraries specified at compile time usually work.  The executable contains a reference to the dynamic/shared library, but the symbol table is missing or incomplete.  Both loading and linking occur at process start, which is considered "dynamic" for linking but not for loading.
            • Dynamic loading, dynamic linking.  This is what happens when you calldlopen or its equivalent on other systems.  The object file is loaded dynamically under program control (i.e. after start), and symbols both in the calling program and in the library are resolved based on the process's possibly-unique memory layout at that time.
            • Static loading, static linking.  Everything is resolved at compile time.  At process start everything is loaded into memory immediately and no extra resolution (linking) is necessary.  In the abstract it's not necessary for the loading to occur from a single file, but I don't think the actual formats or implementations (at least those I'm familiar with) can do multi-file loading without dynamic linking.
            大香伊人久久精品一区二区| 国产高潮国产高潮久久久91| 蜜臀久久99精品久久久久久| 美女久久久久久| 亚洲午夜久久久久久久久久 | 久久免费看黄a级毛片| 无码人妻久久久一区二区三区| 久久97精品久久久久久久不卡| 理论片午午伦夜理片久久 | 久久精品国产99久久无毒不卡| 99久久99久久精品国产片| 久久久久亚洲AV无码专区首JN | 精品无码久久久久久久动漫| 色诱久久av| 欧美激情精品久久久久| 精品久久久无码21p发布 | 91精品国产91久久久久福利| 久久久久99这里有精品10 | 亚洲国产精品一区二区久久hs| 国产成人AV综合久久| 久久久亚洲欧洲日产国码aⅴ| 亚洲精品无码久久毛片| 国产伊人久久| 亚洲精品国产成人99久久| 久久久久人妻精品一区二区三区| 久久受www免费人成_看片中文| 久久成人18免费网站| 一级做a爰片久久毛片人呢| 久久香蕉超碰97国产精品| 久久久SS麻豆欧美国产日韩| 欧美日韩精品久久久免费观看| 91精品国产高清久久久久久91| 国产精品久久成人影院| 久久国产热精品波多野结衣AV| 无码人妻精品一区二区三区久久 | 精品国产婷婷久久久| 99久久成人18免费网站| yellow中文字幕久久网| 色综合久久综合网观看| 久久国产午夜精品一区二区三区| 国产精品久久久久久久午夜片|