This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Uninitialized variables is getting assigned to DATA section instead of BSS section in ARM Compiler 6.6

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?

Parents
  • I assume that you mean uninitialized global variables here. Such a variable is placed in .bss by the compiler in the object file. The linker is very flexible, so maybe you have inadvertently asked it to place bss data from object files into general data sections in the executable image? With fromelf -s you should be able to see where it goes wrong (object or image) and which symbol is placed in which section, and check the section type/flags to see if this is a .bss (SHT_NOBITS is set) or a .data (SHT_PROGBITS and SHF_WRITE are set). Hope this helps.

Reply
  • I assume that you mean uninitialized global variables here. Such a variable is placed in .bss by the compiler in the object file. The linker is very flexible, so maybe you have inadvertently asked it to place bss data from object files into general data sections in the executable image? With fromelf -s you should be able to see where it goes wrong (object or image) and which symbol is placed in which section, and check the section type/flags to see if this is a .bss (SHT_NOBITS is set) or a .data (SHT_PROGBITS and SHF_WRITE are set). Hope this helps.

Children
No data