The OS X Terminal is a very powerful tool for configuring and using a Mac, and can be used to script and program a number of aspects of the computer's operations; however, its text-based interface can be a bit of a cryptic environment to first-timers, especially when it comes to finding out what you can use it for.
With Leopard, Apple has unleashed the greatest version of Mac OS X yet, and David Pogue is back with another meticulous Missing Manual to cover the operating system with a wealth of detail. The new Mac OS X 10.5, better known as Leopard, is faster than its predecessors, but nothing's too fast for Pogue and this Missing Manual. I'm having a lot of trouble compiling the otherwise excellent Contiki OS on my macbook pro (with mac os x 10.6). Contiki actually uses a lot of GNU-specific features and options of GCC, AR, LD,.
There are thousands of Terminal commands available, but when you first launch it you might not have a clue where to look for them. Of course there are basic commands like 'ls' for listing directory contents or 'cd' for changing directory, but in addition there are text editors, string parsers, expression managers, and numerous other commands that, depending on the purpose, can make the Terminal a hidden but exceptionally powerful tool.
If you are just getting started with using the Terminal, you may find it useful to build your command vocabulary. There are many resources such as the BSD Unix command summary that will give you a quick overview of the common commands; another approach is to list all commands available to you and then look up the manual page of each individually to see what its purpose is and how it's used.
There are a number of ways to list all of the commands, but two quick ones are Tab completion and the 'compgen' command. For Tab completion, simply type something in Terminal and hit Tab once or twice (and if prompted, confirm that you want the options displayed) and the system will list all available commands based on the text you entered.
If you press the Tab key without having entered any text, then the Terminal will output all possible commands (after you confirm that you want it to do so). If you do this, it helps to make the Terminal window as large as possible. You can then press Enter to display more items that are off the page until you are dropped to the command prompt again, but then you can scroll up and down to review the commands that were listed.
![]()
The second option is to list the commands and aliases available to you using the 'compgen' built-in command. Simply type the following command, and you will be given the full alphabetical list of commands available to you in the system:
compgen -ca
Mac Os X Manual Page For Lds
You can also redirect the output to a text file on your desktop called 'commands.txt' to peruse later:
compgen -ca > ~/Desktop/commands.txt
Referring to this list of commands, you can then look each up using the Terminal commands 'man' for the full manual page or 'whatis' for a brief synopsis of what it does. For instance, unlike the command 'diskutil' it may be difficult to guess what the command 'xattr' does from its name, so you can quickly look this up by running the following:
whatis xattr
Mac Os X Manual Page For Ld 1
Note: If the whatis command is not working then run the command '/usr/libexec/makewhatis' in the Terminal.
You can find more information and specifics on how to use the command through its manual page. There are a number of approaches to viewing a manual page for a command, with four that may be most useful:
Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.
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/2operating 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 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; as a result, 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]
Service hotline We use cookies (our own and those of third parties) to make it easier for you to use our websites. With the further use of our web pages, you agree to the use of cookies.
![]() 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.
Bing For Mac Os X
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.
Mac Os X Manual Page For Ld 10Multics[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.
See also[edit]Notes[edit]
References[edit]
Mac Os X Manual Page For Ld XFurther reading[edit]
External links[edit]
Mac Os X Manual Page For Ld 2
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Dynamic_linker&oldid=908656741'
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |