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 LinkerThis links the file test1.obj and generates the file test.out.This file is used again and linked togetherwith test2.obj to create the file test.abs (the default name if no output filename is given in the defaultELF/DWARF <strong>for</strong>mat).With incremental linking it is normal to have unresolved references in the output file until all .obj filesare linked and the final .out or .abs file has been reached.The option --incremental (-r) <strong>for</strong> incrementallinking also suppresses warnings and errors because of unresolved symbols.8.5. Importing Binary FilesWith the <strong>TASKING</strong> linker it is possible to add a binary file to your absolute output file. In an embeddedapplication you usually do not have a file system where you can get your data from. With the linker option--import-object you can add raw data to your application. This makes it possible <strong>for</strong> example to displayimages on a device or play audio.The linker puts the raw data from the binary file in a section.The sectionis aligned on a 4-byte boundary.The section name is derived from the filename, in which dots are replacedby an underscore. So, when importing a file called my.mp3, a section with the name my_mp3 is created.In your application you can refer to the created section by using linker labels.For example:#include extern char _lc_ub_my_mp3; /* linker labels */extern char _lc_ue_my_mp3;char* mp3 = &_lc_ub_my_mp3;void main(void){int size = &_lc_ue_my_mp3 - &_lc_ub_my_mp3;int i;<strong>for</strong> (i=0;i

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

Saved successfully!

Ooh no, something went wrong!