Invocation
and
Operation
of
the
TMS34010
C
Compiler
3.7.2
Object
Libraries and
Run-Time
Support
The archive library RTS.LlB contains code for
boot.obj,
plus all additional C
run-time support functions. These functions
are
described in Section 6,
TMS34010
Run-Time Support.
If
your
program uses any
of
these functions,
RTS.LlB must be
linked in
with
your
object files.
Any
program
that
uses floating
point
math must include the
TMS34010
floating
point
library,
which
contains functions called
by
the compiled
pro-
gram
to
perform floating
point
operations. This library
is
called
FLlB.LlB
(see
Appendix
D
for
more information
about
the floating
point
library).
Note:
Programs that
do
not
use floating
point
need
not
be linked
with
FLlB.LlB.
You can create your
own
object libraries and link them in. The linker operates
so
that
only
those modules from the library
that
define unresolved references
will
be included and linked. Refer
to
the detailed linker documentation in
TMS34010
Assembly Language Tools User's Guide.
3.7.3
The
-c
Option
in
the
Linker
The linker has
an
option
-c
to
ease
linking C programs. Use the
-c
option
on
the command
line
or
in the
link
control file. The
-c
option
has the
following
effects:
• Forces
-c-intOO
to
be the entry point.
-c-intOO
is
the start
of
the
run-time initialization code in boot.obj. This
also causes
boot.obj
to
be
included from the archive library since
boot.obj
is
the module that de-
fines the
symbol
-c-intOO.
• Adds
two
bytes
of
zero padding at the end
of
the .data section. This
is
required
to
terminate the initialization tables.
3.7.4
Linker
Command
File
3-8
The
following
is
an
example
of
a typical command file
for
linking a C program.
The C program consists
of
two
C modules,
main.obj
and sub.obj, and
an
as-
sembly language module, asm.obj. The program uses floating
point
and se-
veral routines from
an
archive library called matrix.lib.
-c
-m
example.map
-0
example.out
main.obj
sub.obj
asm.obj
flib.lib
rts.lib
matrix.
lib
/*
linking
a C
program
*/
/*
create
a map
file
*/
/*
specify
name
of
output
file
*/
/*
user's
first
C
module
*/
/*
user's
secondC
module
*/
/*
user's
asm
module
*/
/*
floating
point
library
*/
/*
run-time
support
library
*/
/*
user's
archive
library
*/