i960 Processor Compiler User's Guide
2-12
2
Example 2-1 Sample .gld File
gcc:-ACA
crt:%{!crt:%[~]/lib/%{mpid:%{G:crt960_e.o}%{!G:crt960_p.o}}
%{!mpid:%{G:crt960_b.o}%{!G:crt960.o}}}
ld:%{!Ttext:-Ttext 0xA0008000}%{*: -defsym
_heap_size=0x20000;_heap_base=(_end+0xf)&~0xf;_heap_end=_heap_base+_heap_size-
1;_stackbase=(_heap_end+0x40)&~0x3f -defsym fpem_CA_AC=0x100}
lib:%{!nostdlib:-lmn -lll}
In the .GLD file, you can place any options that the tools accept on the
command line. For example, in the
.GLD file shown in Example 2-1, you
see options for the gcc960 compiler driver and linker.
The command in the
gcc: section defines the architecture setting for the
gcc960 compiler driver. This setting is then used throughout the
compilation process. The options following
gcc: are treated in the same
fashion as if they were specified on the gcc960 invocation line.
The commands in the
crt:, ld:, and lib: sections have a conditional
component built into them so that options could be included in a
conditional fashion. These sections determine the startup code, linker
options and the libraries that are passed on to the linker.
The
crt: section is used to specify the startup code. In the example
given above, if the
-crt option has not been specified on the compile
line, then the compiler driver uses the following for the startup code.
[G960BASE]/lib/crt960_e.o if both -mpid and -G options are on
[G960BASE]/lib/crt960_p.o if -mpid option is on -G is off
[G960BASE]/lib/crt960_b.o if -mpid option is off and -G is on
[G960BASE]/lib/crt960.o if both -mpid and -G options are off