[EXT_EP-10762] Function local static array allocated to .data section, and not .bss Created: 21/Mar/22 Updated: 27/Apr/22 Resolved: 27/Apr/22 |
|
Status: | Fixed |
Project: | Embedded Software & Tools |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Medium |
Reporter: | TI User | Assignee: | TI User |
Resolution: | Fixed | Votes: | 0 |
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Product: | Code Generation Tools |
Internal ID: | CODEGEN-9779 |
Found In Release: | ARMCLANG_2.0.0.STS ARMCLANG_1.3.1.LTS |
Fix In Release: | ARMCLANG_2.1.0.LTS ARMCLANG_1.3.2.LTS* |
Affected Platform/Device: | default |
Description |
The attached test case defines and uses a global array and a function local static array. Build it ... % tiarmclang -S file.c Inspect the assembly to see these lines for the definition of the static array ... .section .data.fxn.static_array,"aw",%progbits .p2align 2 fxn.static_array: .zero 400 Compare that to the definition of the global array ... .comm global_array,400,4 It's in the common section, which eventually becomes .bss. The 400 bytes of zero in the .data section is a waste of memory. It would be better for the static array to be in .bss, and then get zero initialized by the startup code. |