Hi
I want to get the BSS section and .constdata seciton's base address and size in C code. Does anyone knows how to get them ? Thanks very much !
The linker will define symbols; for gcc-arm-none-eabi at least, they look like: __bss_start__, __bss_end__, __data_start__, and __data_end__
In C, use their addresses:
extern uint8_t __bss_start__, __bss_end__, __data_start__, __data_end__; printf("BSS Start = %08x, size = %d\n", &__bss_start__, &__bss_end__ - &__bss_start__);
(I believe Keil does the same thing)
Thanks, but I don't the symbol rule in Keil, a document said use 'Section$$Base/Limit', I tried but not correct.
Are you sure?https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_pge1362066045758.htm
(Hmm. Different number of underlines for the data section?)I tried using an old UV4. and it did NOT work :-( I could not find a linker option that specifically enables this.Nor could I find any likely looking symbols in the .map file :-(
Yes, I search lots of websites, can't find the answer. But I think it should be a very common requirement.
Are you using the Free version of the compiler ("MDK-Lite")? There is this somewhat worrying statement in the "restrictions" document that might explain why we can't get it working:
The assembler and linker create Symbolic Output Format objects which cannot be linked with third-party linker utilities. Fully licensed tools generate standard ELF/DWARF files which may be used with third-party utilities.
Hi Bill
Thanks for your reply.
My Version is: MDK-ARM Professional Version 5.21a, is it MDK-Lite ?
And what is you said third-party utilities ?
And which format is used for constdata section start address ? constdata$$Base or __constdata_start?