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.)

你可能感兴趣的:(linux,Security,System,library,behavior,linker)