Skip to Content
Programming Embedded Systems in C and C++
book

Programming Embedded Systems in C and C++

by Michael Barr
January 1999
Beginner to intermediate
200 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Programming Embedded Systems in C and C++
Linking 23
Most object files begin with a header that describes the sections that follow. Each
of these sections contains one or more blocks of code or data that originated
within the original source file. However, these blocks have been regrouped by the
compiler into related sections. For example, all of the code blocks are collected
into a section called text, initialized global variables (and their initial values) into
a section called data, and uninitialized global variables into a section called bss.
There is also usually a symbol table somewhere in the object file that contains the
names and locations of all the variables and functions referenced within the source
file. Parts of this table may be incomplete, however, because not all of the vari-
ables and functions are always defined in the same file. These are the symbols that
refer to variables and functions defined in other source files. And it is up to the
linker to resolve such unresolved references.
Linking
All of the object files resulting from step one must be combined in a special way
before the program can be executed. The object files themselves are individually
incomplete, most notably in that some of the internal variable and function refer-
ences have not yet been resolved. The job of the linker is to combine these object
files and, in the process, to resolve all of the unresolved symbols.
The output of the linker is a new
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

You might also like

Embedded Systems Object-Oriented Programming in C and C++

Embedded Systems Object-Oriented Programming in C and C++

Israel Gbati

Publisher Resources

ISBN: 1565923545Catalog PageErrata