0l, 5l, 6l, 7l, 8l, 9l, ql, vl – loaders|
8l [ option ... ] [ file ... ]|
These commands load the named files into executable files for
the corresponding architectures; see 8c(1) for the correspondence
between an architecture and the character (6, 8, etc.) that specifies
it. The files should be object files or libraries (archives of
object files) for the appropriate architecture. Also, a name like
–lext represents the library libext.a in /$objtype/lib, where objtype
is one of 386, etc. as listed in 8c(1). If the environment variable
ccroot is defined, the library is sought in $ccroot/$objtype/lib
instead. The libraries must have tables of contents (see ar(1)).
In practice, –l options are rarely necessary as the header files for the libraries cause their archives to be included automatically in the load (see 8c(1)). For example, any program that includes header file libc.h causes the loader to search the C library /$objtype/lib/libc.a. Also, the loader creates an undefined symbol _main (or _mainp if profiling is enabled) to force loading of the startup linkage from the C library.
The order of search to resolve undefined symbols is to load all files and libraries mentioned explicitly on the command line, and then to resolve remaining symbols by searching in topological order libraries mentioned in header files included by files already loaded. When scanning such libraries, the algorithm is to scan each library repeatedly until no new undefined symbols are picked up, then to start on the next library. Thus if library A needs B which needs A again, it may be necessary to mention A explicitly so it will be read a second time.
The loader options are:
–Tt The text segment starts at (virtual) address t.
–Pt (ELF only) The text segment starts at physical address t (by default the text segment's virtual start address).
–Dd The data segment starts at address d.
–Rr The text segment is rounded to a multiple of r (if r is nonzero).
–Ldir For a library reference –lext, search dir before looking in the standard library directory. If more than one –L option is given, directories will be searched in order of appearance.
The numbers in the above options can begin with 0x or 0 to change the default base from decimal to hexadecimal or octal. The defaults for the values depend on the compiler and the header type.
The loaded image has several symbols inserted by the loader: etext is the address of the end of the text segment; bdata is the address of the beginning of the data segment; edata is the address of the end of the data segment; and end is the address of the end of the bss segment, and of the program.
/$objtype/lib for –llib arguments.|
8c(1), 8a(1), ar(1), nm(1), db(1), prof(1) |
Rob Pike, ``How to Use the Plan 9 C Compiler''
The list of loaders given above is only partial, not all architectures
are supported on all systems, some have been retired and some
are provided by third parties.|