f78 Using GNU tools on embedded systems
Contents | Index | Next | Previous

Using GNU tools on embedded systems  

The following seven GNUPro Toolkit tools can be run on embedded targets.
See the following documentation for more discussion on using the GNU tools.

Invoking the GNU tools

 

gcc, the GNU compiler

 

cpp, the GNU preprocessor

gas, the GNU assembler

 

ld, the GNU linker

.coff for object file formats

binutils, the GNU binary utilities

gdb, the debugging tool

The most common approach means using the following processes.

libgloss, newlib and libstd++, the GNU libraries

crt0, the main startup file

The linker script

Memory map

Constructor and destructor tables for g++

    Set up the .text section, using the following example's input.

Default values for variables, _bss_start and _end

I/O support code

Most applications use calls to the standard C library. However, when you initially link libc.a, several I/O functions are undefined. If you don't plan on doing any I/O, you're OK; otherwise, you need to create two I/O functions: open() and close(). These don't need to be fully supported unless you have a file system, so they are normally stubbed out, using kill().
sbrk() is also a stub, since you can't do process control on an embedded system, and it is only needed by applications that do dynamic memory allocation. It uses the variable, _end, which is set in the linker script.
The following routines are also used for optimization.
   

Memory support

The following routines are for dynamic memory allocation.
   

Miscellaneous support routines

The following support routines are called by newlib, although they don't apply to the embedded environment.
0