shared libraries在unix-like系统上的实现的一些差别

再次看到,记录在这里以防自己忘掉:)


关于shared libraries在unix-like系统上的实现的一些差别

摘自Linker and loader的chapter 9

In the rest of this chapter we concentrate on the static sharedlibraries provided in UNIX System V Release 3.2 (COFF format),older Linux systems

(a.out format), and the BSD/OS derivative of4.4BSD (a.out and ELF for-

mats.) All three work nearly the same, butsome of the differences are in-

structive. The SVR3.2 implementation requiredchanges in the linker to

support searching shared libraries, andextensive operating system support

todo the runtime startup required. The Linux implemention requiredone

small tweak to the linker and added a singlesystem call to assist in library

mapping. The BSD/OS implementation made nochanges at all to the

linker or operating system, using a shellscript to provide the necessary ar-

guments to the linker and a modified versionof the standard C library

startup routine to map in thelibraries.


关于LD_LIBRARY_PATH

Ifthere’s an environment symbol LD_LIBRARY_PATH, it’s treat-
   ed as a colon-separated listof directories in which the linker looks
  for the library. This lets a developer build anew version of a li-
 brary, put it in the LD_LIBRARY_PATH and use itwith existing
linked programs either to test the new library, or equally well toin-
strument the behavior of the program. (It skips this step ifthe pro-
gram isset-uid, for security reasons.)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值