Keil Logo Arm Logo

Linker User Guide

Importing linker-defined symbols in C and C++

Importing linker-defined symbols in C and C++

You can import linker-defined symbols into your C or C++ source code either by value or by reference:

Import by value

extern unsigned int symbol_name;

Import by reference

extern void *symbol_name;

If you declare a symbol as an int, then you must use the address-of operator (&) to obtain the correct value as shown in these examples:

Example 3. Importing a linker-defined symbol

extern unsigned int Image$$ZI$$Limit;
config.heap_base = (unsigned int) &Image$$ZI$$Limit;

Example 4. Importing symbols that define a ZI output section

extern unsigned int Image$$ZI$$Length;
extern char Image$$ZI$$Base[];
memset(Image$$ZI$$Base,0,(unsigned int)&Image$$Length);

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0377D
Non-ConfidentialID062912

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.