Although the majority of people use the Blackfin toolchain to compile applications which run under the Linux kernel, many people use it to compile applications, which run with no operating system, or are operating systems by themselves. Examples of this would be the Linux kernel, U-Boot, RTEMS, or bare metal applications. The rest of this chapter assumes that you are interested in compiling applications which run while the Linux kernel is also running.
The Blackfin toolchain consists of several utilities which accomplish the basic tasks required to create executable programs, compiling, assembling, and linking and can output files in many different formats. For information on the different toolchains, see the Blackfin toolchain targets page. For information on the file formats, see the Blackfin executable formats page. Regardless of the exact toolchain or the final output format, the process is the same. Standard C code is converted into Blackfin assembly code by the compiler
bfin-…-gcc. This is fed to the assembler,
bfin-…-as, which produces ELF objects. Commonly these ELF objects are collected together by the
bfin-…-ar archiving utility to produce a static library (libXX.a). In the end, the ELF objects and static libraries are fed collectively to the linker
bfin-…-ld which produces the final ELF. At this point, the ELF is either directly usable or converted into the final format.
The way in which the compiler controls the assembler, linker, and archiver depends on the source input files and the compiler options used.