
Compiling 21
development computer (usually a PC or Unix workstation) from the target embed-
ded system, it is referred to as the host computer. In other words, the compiler,
assembler, linker, and locator are all pieces of software that run on a host com-
puter, rather than on the embedded system itself. Yet, despite the fact that they
run on some other computer platform, these tools combine their efforts to pro-
duce an executable binary image that will execute properly only on the target
embedded system. This split of responsibilities is shown in Figure 3-2.
In this chapter and the next I’ll be using the GNU tools (compiler, assembler,
linker, and debugger) as examples. These tools are extremely popular with
embedded software developers because they are freely available (even the source
code is free) and support many of the most popular embedded processors. I will
use features of these specific tools as illustrations for the general concepts dis-
cussed. Once understood, these same basic concepts can be applied to any equiv-
alent development tool.
Compiling
The job of a compiler is mainly to translate programs written in some human-
readable language into an equivalent set of opcodes for a particular processor. In
that sense, an assembler is also a compiler (you might call it an “assembly lan-
guage compiler”) but one that performs a much simpler one-to-one translation
from one line of human-readable ...