| Dynamic Linker |
Article Index for Dynamic |
Website Links For Dynamic |
Information AboutDynamic Linker |
| CATEGORIES ABOUT DYNAMIC LINKER | |
| computer libraries | |
| security exploits | |
| unix | |
|
UNIX AND UNIX-LIKES On Unix and Unix-like operating systems, the dynamic linker shared libraries vary. Two common ones are ''ld.so'' on BSD and ''ld-linux.so'' on Linux . These typically change their behaviour based on a common set of Environment Variable s, including ''LD_LIBRARY_PATH'' and ''LD_PRELOAD''. ''LD_PRELOAD'' instructs the loader to load additional libraries into a program, beyond what was specified when it was compiled. It allows users to add or replace functionality when they run a program and can be used for beneficial purposes, such as implementing Userspace Virtual File System s or debuggers, or malicious, to run code the program authors didn't intend. For this reason, LD_PRELOAD is often ignored when a program is running Setuid and under a few other circumstances. MAC OS X On the Mac OS X operating system, dynamic libraries are stored in a format known as a "dylib" (for dynamically linked/loaded shared library.) These libraries are linked at run-time by Mac OS X's dynamic linker, dyld. At the beginning of every Mac OS X executable (a Mach-O binary) are a set of Load Commands . If an application needs to use a dynamic library, it specifies in its load commands the dynamic linker to use (always dyld) and the path where the library to be used is most likely located. dyld is called and attempts to find the library specified. If it is not in the expected location, certain other paths are searched (set by a user environment variable). If the library is not found there, the application fails and does not launch. After the library is found, dyld will either link the unresolved symbols immediately or only when they are called depending on whether or not lazy linking was specified in the Source Code of the application. There is currently no way to remove a library from an application once it has been loaded in. However, libraries in Mac OS X are shared between applications - one version of the library is loaded into memory and all applications use it, therefore there is no need to unload a library (as, supposing that another application is using it, which might not in reality be the case in a statistically insignificant number of cases, it will not save resources.) EXTERNAL LINKS |
|
|