The main task of a linker script is to define extra symbols and define how input sections map into output sections. It has other miscellaneous features which can be implemented via command line options:
- The
ENTRY
command can be replaced by--entry
. - The
OUTPUT_FORMAT
command can usually be replaced by-m
. - The
SEARCH_DIRS
command can be replaced by-L
. - The
VERSION
command can be replaced by--version-script
. - The
INPUT
andGROUP
commands can add other files as input. This provides a mechanism to split an archive/shared object into multiple files.