Global variables are accessed in a linker command file with an `F' prepended to the symbol name. This is because the compiler adds an `F' prefix to externally defined symbols.
The following listing shows an example of using a global variable in a linker command file. This example sets the global variable _foot, declared in C with the extern keyword, to the location of the address location current counter.
F_foot = .;
If you use a global symbol in an LCF, as in the above listing, you can access it from C program sources as shown in the following listing.
extern unsigned long _Lstack_addr[]; int main(void) { unsigned long* StackStartAddr; StackStartAddr = _Lstack_addr;