什么叫| 淋巴吃什么药好| 胃体隆起是什么意思| 孕中期宫缩是什么感觉| 喉炎是什么原因引起的| 甲状腺功能亢进吃什么药| 肝郁气滞吃什么中成药| 颈椎病用什么枕头好| 黄皮果是什么水果| 长期喝枸杞水有什么好处和坏处| 怀孕哭对宝宝有什么影响| 什么闻什么睹| 胳膊肘往外拐是什么意思| 文五行属什么| 牧师是什么意思| 颜控什么意思| 分率是什么意思| 静脉曲张是什么病| 行政许可是什么意思| 腰椎间盘突出和膨出有什么区别| 一泻千里是什么意思| 二月份出生的是什么星座| 第一次同房是什么感觉| 唐字五行属什么| 孕妇梦见摘桃子是什么意思| 1月13日什么星座| 经期头疼吃什么药效果最好| 牙疼可以吃什么| 百利甜酒兑什么最好喝| 什么可以代替润滑油| 县武装部长是什么级别| AC是胎儿的什么意思| 室性早搏是什么意思| 尿频尿急是什么症状| 申请低保需要什么条件| 涧是什么意思| 胃疼什么原因| 真维斯属于什么档次| 起水泡痒是什么原因| 钟爱一生是什么意思| 64年属什么生肖| 月经为什么会推迟| 白芷炖肉起什么作用| 睡觉梦到蛇是什么意思| 生小孩需要准备什么| 为什么早上起来眼睛肿| 琥珀是什么颜色| 结缔组织是什么| 一个火一个华念什么| 吃什么可以增强记忆力| 宫颈纳囊什么意思| 女儿的女儿叫什么| dic是什么意思| 掉头发是缺什么维生素| 仓鼠突然死了是为什么| 三级护理是什么意思| 请大家知悉是什么意思| 哺乳期吃什么奶水多| spect是什么检查| 山竹不能和什么水果一起吃| 拉黑一个人意味着什么| 头颈出汗多是什么原因| 狐臭挂什么科| 谷草转氨酶偏高是什么原因| 罗红霉素胶囊治什么病| 什么病不能吃丝瓜| 榆钱是什么| 眼睛干涩用什么眼药水| 眼珠子疼是什么原因| 人体7大营养素是什么| 什么肉是碱性的| 3岁宝宝流鼻血是什么原因| 梦见自己生了个儿子是什么意思| 夜尿增多是什么原因| 尿胆素1十是什么意思| 孩子记忆力差吃什么好| 衣原体感染是什么意思| examine什么意思| 喝黑豆浆有什么好处| 囧是什么意思| 腋毛有什么作用| 七月十日是什么日子| 有甲状腺结节不能吃什么| 尿液中有白色沉淀物是什么原因| 不良于行是什么意思| 女性查hpv挂什么科| 梦见鳄鱼是什么意思| 乳腺结节钙化是什么意思| 尿肌酐低说明什么原因| 水生木是什么意思| 女仆是什么意思| 孙字五行属什么| 支气管激发试验阴性是什么意思| 转氨酶偏高是什么原因引起的| 乳腺彩超能查出什么| 喉咙痛去药店买什么药| 尿液红细胞高是什么原因| 眼睛黄是什么病| tomboy是什么意思| 心无什么用| 孩子睡觉咬牙齿是什么原因引起的| prime是什么意思| 宝宝经常发烧是什么原因引起的| 床单什么颜色有助于睡眠| 减肥吃什么药| nt什么货币| 生门是什么意思| 急性胃炎吃什么食物好| 脚肿吃什么药消肿| 仙灵脾又叫什么| 适宜是什么意思| 吃红枣有什么好处| 平均分是什么意思| 男人射精快吃什么药| 枸杞搭配什么喝最好| 离退休是什么意思| 口腔溃疡什么症状| 小猫呕吐吃什么药| 8月1日是什么节| 吃什么能帮助睡眠| 胃糜烂和胃溃疡有什么区别| 人参有什么功效| 女人肚子大是什么原因| 皮肤瘙痒用什么药好| 血细胞分析是查什么的| 1968属什么生肖| 案山是什么意思| biubiubiu是什么意思| 11月生日是什么星座| 女朋友的妹妹叫什么| 公务员国考和省考有什么区别| 诺五行属什么| 吧唧嘴什么意思| 清道夫吃什么| 魔性是什么意思| 蒲公英叶和根的功效有什么不同| 什么情况下能吃脑络通| 拉屎特别臭是什么原因| 导演是干什么的| 什么的辨认| 投资公司是做什么的| 孕妇吃西红柿对胎儿有什么好处| 路怒症是什么| 预防感冒吃什么药| 96122是什么电话| 明年是什么年啊| nova是什么牌子| 梦见火是什么意思| 五十坐地能吸土是什么意思| 恶作剧是什么意思| 肾绞痛可能由于什么原因引起| 来月经喝红糖水有什么好处| 牙疼脸肿了吃什么药| 产后复查挂什么科| 梦见小男孩是什么预兆| 电是什么时候发明的| 什么牌子的冰箱好用又省电| 杜甫自号什么| 线下是什么意思| 码农是什么意思| 胸腔积液叩诊什么音| 水当当是什么意思| 钠是什么东西| 脚气脱皮用什么药最好| 黄牛用的什么抢票软件| 什么的陪伴| 彩金和黄金有什么区别| 海带是什么植物| 喉咙吞口水痛吃什么药| 乐字五行属什么| 邓超是什么星座| 痔疮吃什么药效果好| 史密斯夫妇什么意思| 高血糖能吃什么水果| 去湿气喝什么茶| 医学cr是什么意思| 8月是什么月| 大熊猫属于什么科| 孕妇多吃什么食物好| 黄体不足吃什么| 手指脱皮是什么原因造成的| 结膜炎吃什么消炎药| naprogesic是什么药| 人渣是什么意思| ccu病房什么意思| 什么是介质| 黑死病是什么| 梦见照相是什么意思| 煮粥用什么锅最好| 为什么一喝水就出汗| 11月1号是什么星座| 手臂粗是什么原因| l5s1椎间盘突出是什么意思| 乙肝恢复期是什么意思| 谷草转氨酶偏低是什么意思| 生蚝和什么不能一起吃| 四月28日是什么星座| 吃芒果有什么好处和坏处| jennie什么意思| 什么的舞蹈| 肠道为什么会长息肉| 牛蒡是什么东西| 蚊香灰有什么作用| 乳腺癌ki67是什么意思| 食管反流吃什么药最好| 高硼硅玻璃是什么材质| 酵母是什么| 兰蔻适合什么年龄的人用| 大姨妈来的少是什么原因| coach是什么牌子的包| 李倩梅结局是什么| 循证是什么意思| 嘴唇有黑斑是什么病| 吃什么药可以推迟月经| 乳腺增生1类什么意思| 兔爷是什么意思| 舌头开裂是什么原因| 口巴读什么| 屁股上长痘痘是什么原因| 自贸区什么意思| 香蕉有什么功效和作用| 扎马步有什么好处| 诺氟沙星胶囊治什么| 贯众是什么植物| 肺热咳嗽吃什么药| 木石是什么字| 1069是什么意思| facebook什么意思| 为什么人会死| 熳是什么意思| 粉色玫瑰花代表什么意思| 吃什么代谢快| 牵牛花又叫什么名字| 湿气重吃什么中药好| 防微杜渐是什么意思| 踏空是什么意思| 判官是什么意思| 包皮炎挂什么科| 黑户是什么意思| 蠼螋对人有什么危害| 奶霜是什么| 826是什么意思| 什么是银屑病| 最近有什么新闻| 晟是什么字| 前白蛋白是什么意思| 脚肿是什么原因| 预判是什么意思| 洲际导弹是什么意思| 阴道发热是什么原因| 喝什么泡水降血压最好| 石榴什么时候成熟| 一片什么| 梦见胎死腹中预示什么| 新生儿便秘吃什么好| 月经期间能吃什么水果| 秦朝为什么那么快灭亡| 把子肉是什么| 宅心仁厚是什么意思| 纸片人什么意思| 婚检有什么项目| 血压高有什么表现| 反映是什么意思| 马蜂吃什么| 百度

人民网评:主席宪法宣誓昭示了什么

(Redirected from Dynamic linking)
百度 近年来,大兴区持续推动高端产业领军人才发展示范区建设,先后出台了《建设高端产业领军人才发展示范区的实施意见》及《实施办法》等系列政策,开展新创工程领军人才评选。

In computing, a dynamic linker is the part of an operating system that loads and links the shared libraries needed by an executable when it is executed (at "run time"), by copying the content of libraries from persistent storage to RAM, filling jump tables and relocating pointers. The specific operating system and executable format determine how the dynamic linker functions and how it is implemented.

Linking is often referred to as a process that is performed when the executable is compiled, while a dynamic linker is a special part of an operating system that loads external shared libraries into a running process and then binds those shared libraries dynamically to the running process. This approach is also called dynamic linking or late linking.

Implementations

edit

Microsoft Windows

edit

Dynamic-link library, or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries usually have the file extension DLL, OCX (for libraries containing ActiveX controls), or DRV (for legacy system drivers). The file formats for DLLs are the same as for Windows EXE files – that is, Portable Executable (PE) for 32-bit and 64-bit Windows, and New Executable (NE) for 16-bit Windows. As with EXEs, DLLs can contain code, data, and resources, in any combination.

Data files with the same file format as a DLL, but with different file extensions and possibly containing only resource sections, can be called resource DLLs. Examples of such DLLs include multi-language user interface libraries with extension MUI, icon libraries, sometimes having the extension ICL, and font files, having the extensions FON and FOT.[1]

Unix-like systems using ELF, and Darwin-based systems

edit

In most Unix-like systems, most of the machine code that makes up the dynamic linker is actually an external executable that the operating system kernel loads and executes first in a process address space newly constructed as a result of calling exec or posix_spawn functions. At link time, the path of the dynamic linker that should be used is embedded into the executable image.

When an executable file is loaded, the operating system kernel reads the path of the dynamic linker from it and then attempts to load and execute this other executable binary; if that attempt fails because, for example, there is no file with that path, the attempt to execute the original executable fails. The dynamic linker then loads the initial executable image and all the dynamically-linked libraries on which it depends and starts the executable. As a result, the pathname of the dynamic linker is part of the operating system's application binary interface.

Systems using ELF

edit

In Unix-like systems that use ELF for executable images and dynamic libraries, such as Solaris, 64-bit versions of HP-UX, Linux, FreeBSD, NetBSD, OpenBSD, and DragonFly BSD, the path of the dynamic linker that should be used is embedded at link time into the .interp section of the executable's PT_INTERP segment. In those systems, dynamically loaded shared libraries can be identified by the filename suffix .so (shared object).

The dynamic linker can be influenced into modifying its behavior during either the program's execution or the program's linking, and the examples of this can be seen in the run-time linker manual pages for various Unix-like systems.[2][3][4][5][6] A typical modification of this behavior is the use of LD_LIBRARY_PATH and LD_PRELOAD environment variables, which adjust the runtime linking process by searching for shared libraries at alternate locations and by forcibly loading and linking libraries that would otherwise not be, respectively. An example is zlibc,[7] also known as uncompress.so,[a] which facilitates transparent decompression when used through the LD_PRELOAD hack; consequently, it is possible to read pre-compressed (gzipped) file data on BSD and Linux systems as if the files were not compressed, essentially allowing a user to add transparent compression to the underlying filesystem, although with some caveats. The mechanism is flexible, allowing trivial adaptation of the same code to perform additional or alternate processing of data during the file read, prior to the provision of said data to the user process that has requested it.[8][9]

macOS and iOS

edit

In the Apple Darwin operating system, and in the macOS and iOS operating systems built on top of it, the path of the dynamic linker that should be used is embedded at link time into one of the Mach-O load commands in the executable image. In those systems, dynamically loaded shared libraries can be identified either by the filename suffix .dylib or by their placement inside the bundle for a framework.

The dynamic linker not only links the target executable to the shared libraries but also places machine code functions at specific address points in memory that the target executable knows about at link time. When an executable wishes to interact with the dynamic linker, it simply executes the machine-specific call or jump instruction to one of those well-known address points. The executables on the macOS and iOS platforms often interact with the dynamic linker during the execution of the process; it is even known that an executable might interact with the dynamic linker, causing it to load more libraries and resolve more symbols, hours after it initially launches. The reason that a macOS or iOS program interacts with the dynamic linker so often is due both to Apple's Cocoa and Cocoa Touch APIs and Objective-C, the language in which they are implemented (see their main articles for more information).

The dynamic linker can be coerced into modifying some of its behavior; however, unlike other Unix-like operating systems, these modifications are hints that can be (and sometimes are) ignored by the dynamic linker. Examples of this can be seen in dyld's manual page.[10] A typical modification of this behavior is the use of the DYLD_FRAMEWORK_PATH and DYLD_PRINT_LIBRARIES environment variables. The former of the previously-mentioned variables adjusts the executables' search path for the shared libraries, while the latter displays the names of the libraries as they are loaded and linked.

Apple's macOS dynamic linker is an open-source project released as part of Darwin and can be found in the Apple's open-source dyld project.[11]

XCOFF-based Unix-like systems

edit

In Unix-like operating systems using XCOFF, such as AIX, dynamically-loaded shared libraries use the filename suffix .a.

The dynamic linker can be influenced into modifying its behavior during either the program's execution or the program's linking. A typical modification of this behavior is the use of the LIBPATH environment variable. This variable adjusts the runtime linking process by searching for shared libraries at alternate locations and by forcibly loading and linking libraries that would otherwise not be, respectively.

OS/360 and successors

edit

Dynamic linking from Assembler language programs in IBM OS/360 and its successors is done typically using a LINK macro instruction containing a Supervisor Call instruction that activates the operating system routines that makes the library module to be linked available to the program. Library modules may reside in a "STEPLIB" or "JOBLIB" specified in control cards and only available to a specific execution of the program, in a library included in the LINKLIST in the PARMLIB (specified at system startup time), or in the "link pack area" where specific reentrant modules are loaded at system startup time.

Multics

edit

In the Multics operating system all files, including executables, are segments. A call to a routine not part of the current segment will cause the system to find the referenced segment, in memory or on disk, and add it to the address space of the running process. Dynamic linking is the normal method of operation, and static linking (using the binder) is the exception.

Efficiency

edit

Dynamic linking is generally slower (requires more CPU cycles) than linking during compilation time,[12] as is the case for most processes executed at runtime. However, loading time can be reduced by using "lazy linking", a process in which calls to functions of a library are linked to the implementation (inside the library) only when the first call occurs; a side effect is that, once the program is loaded, the first call to a function would be slower, as the time to link to it was shifted from startup time to run time.

However, dynamic linking is often more space-efficient (on disk and in memory at runtime). When a library is linked statically, every process being run is linked with its own copy of the library functions being called upon. Therefore, if a library is called upon many times by different programs, the same functions in that library are duplicated in several places in the system's memory. Using shared, dynamic libraries means that, instead of linking each file to its own copy of a library at compilation time and potentially wasting memory space, only one copy of the library is ever stored in memory at a time, freeing up memory space to be used elsewhere.[13] Additionally, in dynamic linking, a library is only loaded if it is actually being used.[14]

See also

edit

Notes

edit
  1. ^ Not to be confused with the zlib compression library.

References

edit
  1. ^ Microsoft Corporation. "Creating a Resource-Only DLL". Microsoft Developer Network Library.
  2. ^ ld.so.1(1): Solaris dynamic linker/loader – Solaris 11.4 User Commands Reference Manual
  3. ^ ld-linux.so(8) – Linux Programmer's Manual – Administration and Privileged Commands
  4. ^ rtld(1): FreeBSD dynamic linker/loader – FreeBSD General Commands Manual
  5. ^ ld.elf_so(1): NetBSD dynamic linker/loader – NetBSD General Commands Manual
  6. ^ ld.so(1): OpenBSD dynamic linker/loader – OpenBSD General Commands Manual
  7. ^ "ZLIBC - Transparent access to compressed files". Archived from the original on 2025-08-06.
  8. ^ "uncompress.so". delorie.com. Retrieved 2025-08-06.
  9. ^ "zlibc.conf". delorie.com. Retrieved 2025-08-06.
  10. ^ dyld(1): Darwin/Mac OS X dynamic linker/loader – Darwin and macOS General Commands Manual
  11. ^ Apple Inc. "Open Source - Releases". apple.com. Retrieved 2025-08-06.
  12. ^ Xuxian, Jiang (2009). "Operating Systems Principles: Linking and Loading" (PDF). North Carolina State University. Retrieved 2025-08-06.
  13. ^ Jones, M. (2025-08-06). "Anatomy of Linux dynamic libraries". IBM. Retrieved 2025-08-06.
  14. ^ Sivilotti, Paul (August 2012). "Dynamic Linking and Loading" (PDF). Ohio State University. Retrieved 2025-08-06.

Further reading

edit
edit
无痛人流后需要注意什么 同居是什么意思 胰腺管扩张是什么原因 幼儿园转学需要什么手续 伤口结痂为什么会痒
高原反应吃什么药 运动不出汗是什么原因 怀孕血压高对胎儿有什么影响 什么水果不上火 笑点低是什么意思
着床出血什么时候出现 七宗罪都是什么 蜱虫是什么虫 重视是什么意思 三点水加个有字念什么
胖大海是什么东西 敏是什么意思 dido是什么牌子 高血压适合做什么运动 年薪10万算什么水平
为什么读研hcv7jop4ns7r.cn 一月二十三号是什么星座hcv9jop0ns1r.cn 眼睛干涩用什么眼药水好hcv8jop0ns0r.cn 1944年属什么生肖hcv8jop0ns3r.cn 乳头经常痒是什么原因hcv8jop6ns0r.cn
蛇盘疮长什么样hcv8jop1ns7r.cn 姬松茸和什么煲汤最佳hcv7jop6ns4r.cn 想留不能留才最寂寞是什么歌0735v.com abo溶血症是什么xjhesheng.com 五味指的是什么hcv8jop6ns5r.cn
什么原因导致性功能减退hcv7jop5ns4r.cn 鸟喜欢吃什么hcv8jop0ns6r.cn 高血压可以吃什么水果hcv8jop9ns1r.cn 区委书记什么级别hcv9jop0ns4r.cn 晋升是什么意思hcv8jop4ns7r.cn
睡眠质量差吃什么药zhongyiyatai.com 粗粮是什么hcv7jop7ns4r.cn 吃什么补脑增强记忆力hcv9jop4ns3r.cn 右脸突然肿了是什么原因cj623037.com 家里养什么动物吃蟑螂hcv8jop1ns7r.cn
百度