-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Code Generation Tools
-
CODEGEN-14182
-
-
default
The attached C++ file has these lines ...
#pragma SET_DATA_SECTION(".appblk")
const AppBlk appBlock{(0xAA551234U),
(uint32_t)&_app_start,
(uint32_t)&_app_end,
(uint32_t)&_c_int00,
(uint32_t)&_appblk_crc,
(uint32_t)&_app_crc};
#pragma SET_DATA_SECTION()
The following commands build it with --opt_level set to 1 and 2, and compare how the section .appblk is defined.
% armcl -@options.txt -s --opt_level=1 file.cpp & findstr appblk file.asm | findstr sect
appBlock: .usect ".appblk",128,4
% armcl -@options.txt -s --opt_level=2 file.cpp & findstr appblk file.asm | findstr sect
.sect ".appblk"
When built with --opt_level=1 or lower, the section .appblk is uninitialized. When built with --opt_level=2 or higher, the section .appblk is initialized.
Code in the customer's linker command file presumes .appblk is initialized. When .appblk is unintialized, the linker issues the diagnostic ...
warning #99922: Test.out: accessing the raw data of section ".appblk" which is uninitialized according to its section attributes; changes to raw data may be lost