Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow to declare linker symbol in C files
Dear all, As we known, the generated automatically linker script defined many symbols for use. For example: __bss_start. We can use these symbols in source files, for example, in *.S ...
Altera_Forum
Honored Contributor
20 years agoHi,
I have done a further study, I find that no matter how you declare the __bss_start,such as: extern alt_u8 __bss_start; extern alt_u8* __bss_start; extern alt_u16 __bss_start; extern alt_u16* __bss_start; extern alt_u32 __bss_start; extern alt_u32* __bss_start; Then printf("\nThe value of __bss_start: %d\n", (unsigned int)&__bss_start); You'll get the same answer which equal to the value of __bss_start in linker script. So I think in order to use symbols defined in linker script, we should declare them with extern keyword, then use operator& to get their value. Am I right? Thanks for any reply, David