-
Bug
-
Resolution: Fixed
-
Medium
-
Code Generation Tools
-
CODEGEN-11690
-
-
-
default
-
If the user marks lfu variables as "preserve" that have been placed in output sections with type=NOINIT ( via DATA_SECTION pragma or section attribute) then the compiler should not perform initialization on those variables.
However the compiler is incorrectly generating cinit records for above case due to ignoring the DATA_SECTION or attribute(section) settings.
A common use case for above is using --lfu_default=preserve, which will, by default, preserve all global variables. This will include variables being used for memory mapped register sections marked as type=NOINIT. With this bug, the linker will incorrectly generate .cinit records for these NOINIT variables. On cold start, the variables will be incorrectly zero initialized leading to unexpected behavior.
"update" variables get placed in .TI.update output section which by definition should not be type=NOINIT, however if the .TI.update section is marked as type=NOINIT, then .cinit records will still be generated.