
Locating 25
If the same symbol is declared in more than one object file, the linker is unable to
proceed. It will likely appeal to the programmer—by displaying an error mes-
sage—and exit. However, if a symbol reference instead remains unresolved after
all of the object files have been merged, the linker will try to resolve the reference
on its own. The reference might be to a function that is part of the standard
library, so the linker will open each of the libraries described to it on the com-
mand line (in the order provided) and examine their symbol tables. If it finds a
function with that name, the reference will be resolved by including the associ-
ated code and data sections within the output object file.
*
Unfortunately, the standard library routines often require some changes before
they can be used in an embedded program. The problem here is that the standard
libraries provided with most software development tool suites arrive only in object
form. So you only rarely have access to the library source code to make the neces-
sary changes yourself. Thankfully, a company called Cygnus has created a free-
ware version of the standard C library for use in embedded systems. This package
is called newlib. You need only download the source code for this library from the
Cygnus web site, implement a few target-specific functions, and compile the
whole lot. The library can then be linked with your ...