Uninitialized variables is getting assigned to DATA section instead of BSS section in ARM Compiler 6.6.How to resolve this other than placing the variable in .bss.<section_name>?
Is there any other linker/Compiler options available for this?
Thank you for the info.
Please find the detailed info about my query.
unsigned char __attribute__((section(".myregion"))) myData[0x2000];
Base Addr Size Type Attr Idx E Section Name Object
0x20000000 0x00002000 Data RW 6699 .myregion myFile.a(myFile1.obj)
unsigned char __attribute__((section(".bss.myregion"))) myData[0x2000];
0x20000000 0x00002000 Zero RW 6699 .myregion myFile.a(myFile1.obj)
In Case 1, why is the section Type set to "Data"?
Can I have any other way of setting a particular section Type to "Zero" other than using .bss.<section_name>
The compiler by default puts every variable in its own section (-fdata-sections), but if you need a special named section you have the following options that I'm aware of:
The latter seems to be what you want:
// set bss section to .myRegion#pragma clang section bss=".myRegion"unsigned char myData[0x2000];// reset bss section to original#pragma clang section bss=""
View all questions in Arm Compilers forum