10.5.6 Other Linker Script Commands
There are several other linker script commands, which are described briefly:
ENTRY(symbol)
Specify symbol
as the
first instruction to execute in the program. The linker will record the address of this
symbol in the output object file header. This does not affect the Reset instruction or
vector, which must be generated in some other way. By convention, the XC32 linker scripts construct the correct instruction or
vector at address 0x800000.
EXTERN(symbol symbol ...)
Force symbol
to be entered in the output file as an undefined symbol. Doing this may, for example, trigger linking of additional modules from standard libraries. Several symbols may be listed for each EXTERN
, and EXTERN
may appear multiple times. This command has the same effect as the -u
command line option.
FORCE_COMMON_ALLOCATION
This command has the same effect as the -d
command line option: to make XC32 linker
assign space to common symbols even if a relocatable output file is specified (-r
).
NOCROSSREFS(section section ...)
This command may be used to tell XC32 linker to issue an error about any references among certain output sections. In certain types of programs, when one section is loaded into memory, another section will not be. Any direct references between the two sections would be errors.
The NOCROSSREFS
command takes a list of output section names. If the linker detects any cross references between the sections, it reports an error and returns a non-zero exit status. The NOCROSSREFS
command uses output section names, not input section names.
OUTPUT_ARCH(processor_name)
Specify a target processor for the link. This command has the same effect
as the -p
,--processor
command line option. If both are specified, the command line option takes precedence. The
processor name should appear in quotes; for example “32AK1216GC41064”.
OUTPUT_FORMAT(format_name)
The OUTPUT_FORMAT
command names the object file format to use for the output file.
TARGET(bfdname)
The TARGET
command names the object file format to use when reading input files. It affects subsequent INPUT
and GROUP
commands.