You copied the Doc URL to your clipboard.

Methods of importing linker-defined symbols in C and C++

You can import linker-defined symbols into your C or C++ source code. They are external symbols and you must take the address of them.

The only case where the & operator is not required is when the array declaration is used, extern char symbol_name[];.

The following examples show how to obtain the correct value:

Importing a linker-defined symbol
extern int Image$$ZI$$Limit;
heap_base = (uintptr_t)&Image$$ZI$$Limit;
Importing symbols that define a ZI output section
extern int Image$$ZI$$Length;
extern char Image$$ZI$$Base[];
memset(Image$$ZI$$Base, 0, (size_t)&Image$$Length);
Was this page helpful? Yes No