Linking and compiling with CodeWarrior

Document created by Monica Arvizu Employee on Sep 9, 2012Last modified by Diana Torres on Feb 28, 2017
Version 3Show Document
  • View in full screen mode

From your perspective, a CodeWarrior compiler is a single program. Internally, however, a CodeWarrior compiler has two parts:


• The front-end, shared by all CodeWarrior compilers, translates human-readable source code into a platform-independent intermediate representation of the program being compiled

• The back-end, customized to generate software for a target platform, converts the intermediate representation into object code containing data and native instructions for the target processor


Paper-clips-001_large

A CodeWarrior compiler coordinates its front-end and back-end to translate source code into object code in several steps:


• Configure settings requested from the compiler to the CodeWarrior IDE or passed to the linker from the command-line

• Translate human-readable source code into an intermediate representation

• Optionally output symbolic debugging information

• Optimize the intermediate representation

• Convert the intermediate representation to native object code

• Optimize the native object code

• Output the native, optimized object code

 

A linker combines and arranges the object code in libraries and object code generated by compilers and assemblers into a single file or image, ready to execute on the target platform. The CodeWarrior linker builds an executable image in several steps:

• Configure settings requested from the linker to the CodeWarrior IDE or passed to the linker from the command-line

• Read settings from a linker control file

• Read object code

• Search for and ignore unused objects (“deadstripping”)

• Build and output the executable file

• Optionally output a map file

 

You might think these are real hard to cambine and put together to get something to work. If you do think that, it's easier than it looks! I found this reference manual at Freescale web page describing how to use the CodeWarrior compiler and linker tools to build software.

 

4.pngAs a little introduction, let me explain that CodeWarrior build tools are programs that translate source code into object code then organize that object code to create a program that is ready to execute; CodeWarrior often run on a different platform than the programs they generate, meaning, not the host platform but the target platform. The linker now comes into our lives to pull our code off! Great isn't it? Come on, take a look at it!

CodeWarrior build Tools reference

Attachments

    Outcomes