13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using the LinkerTermRelocationin<strong>for</strong>mationSectionSection attributesTargetUnresolvedreferenceDefinitionIn<strong>for</strong>mation about how the linker must modify the machine code instructions whenit relocates addresses.A group of instructions and/or data objects that occupy a contiguous range ofaddresses.Attributes that define how the section should be linked or located.The hardware board on which an application is executing. A board contains at leastone processor. However, a complex target may contain multiple processors andexternal memory and may be shared between processors.A reference to a symbol <strong>for</strong> which the linker did not find a definition yet.8.1.1. Phase 1: LinkingThe linker takes one or more relocatable object files and/or libraries as input. A relocatable object file, asgenerated by the assembler, contains the following in<strong>for</strong>mation:• Header in<strong>for</strong>mation: Overall in<strong>for</strong>mation about the file, such as the code size, name of the source fileit was assembled from, and creation date.• Object code: Binary code and data, divided into various named sections. Sections are contiguouschunks of code that have to be placed in specific parts of the memory. The program addresses startat zero <strong>for</strong> each section in the object file.• Symbols: Some symbols are exported - defined within the file <strong>for</strong> use in other files. Other symbols areimported - used in the file but not defined (external symbols). Generally these symbols are names ofroutines or names of data objects.• Relocation in<strong>for</strong>mation: A list of places with symbolic references that the linker has to replace withactual addresses. When in the code an external symbol (a symbol defined in another file or in a library)is referenced, the assembler does not know the symbol's size and address. Instead, the assemblergenerates a call to a preliminary relocatable address (usually 0000), while stating the symbol name.• Debug in<strong>for</strong>mation: Other in<strong>for</strong>mation about the object code that is used by a debugger. The assembleroptionally generates this in<strong>for</strong>mation and can consist of line numbers, C source code, local symbolsand descriptions of data structures.The linker resolves the external references between the supplied relocatable object files and/or librariesand combines the files into a single relocatable linker object file.The linker starts its task by scanning all specified relocatable object files and libraries. If the linkerencounters an unresolved symbol, it remembers its name and continues scanning. The symbol may bedefined elsewhere in the same file, or in one of the other files or libraries that you specified to the linker.If the symbol is defined in a library, the linker extracts the object file with the symbol definition from thelibrary. This way the linker collects all definitions and references of all of the symbols.Next, the linker combines sections with the same section name and attributes into single sections. Thelinker also substitutes (external) symbol references by (relocatable) numerical addresses where possible.197

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!