[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Each linker target has an emulation. The emulation includes the default linker script, and certain emulations also modify certain types of linker behaviour.
Emulations are created during the build process by the shell script `genscripts.sh'.
The `genscripts.sh' script starts by reading a file in the `emulparams' directory. This is a shell script which sets various shell variables used by `genscripts.sh' and the other shell scripts it invokes.
The `genscripts.sh' script will invoke a shell script in the `scripttempl' directory in order to create default linker scripts written in the linker command language. The `scripttempl' script will be invoked 5 (or, in some cases, 6) times, with different assignments to shell variables, to create different default scripts. The choice of script is made based on the command line options.
After creating the scripts, `genscripts.sh' will invoke yet another shell script, this time in the `emultempl' directory. That shell script will create the emulation source file, which contains C code. This C code permits the linker emulation to override various linker behaviours. Most targets use the generic emulation code, which is in `emultempl/generic.em'.
To summarize, `genscripts.sh' reads three shell scripts: an emulation parameters script in the `emulparams' directory, a linker script generation script in the `scripttempl' directory, and an emulation source file generation script in the `emultempl' directory.
For example, the Sun 4 linker sets up variables in `emulparams/sun4.sh', creates linker scripts using `scripttempl/aout.sc', and creates the emulation code using `emultempl/sunos.em'.
Note that the linker can support several emulations simultaneously,
depending upon how it is configured. An emulation can be selected with
the -m
option. The -V
option will list all supported
emulations.
2.1 `emulparams' scripts 2.2 `scripttempl' scripts 2.3 `emultempl' scripts
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |