I usually don't touch linker script of my development system, sincerely I can't read every details of a linker script, so I'm in trouble now.
As explained in my previous post, I need to avoid zeroing a static big variable, because it is allocated in SDRAM and SDRAM isn't available when zeroing of bss sections (and initialization of data sections) occurs.
My development system allows me to use .noinit section, so I'm studying how it works.
MCUXpresso IDE generates complete linker scripts that automatically manages .noinit sections. These sections aren't added to section table that startup code reads to reset sections of RAM.
What I don't understand is the presence of NOLOAD directive in the linker script:
[...] The linker will process the section normally, but will mark it so that a program loader will not load it into memory.In embedded systems we don't have program loader, at least in my case there isn't any program loader. Code and constant variables are already at the right addresses at startup (Flash is already written). Only variables that changes at runtime must be initialized in RAM, but this is done by startup code, not by a program loader.
So, if startup code doesn't reset .noinit sections (because they aren't added in bss section table by the linker script), what's the exact purpose of NOLOAD directive?
I was tempted to remove NOLOAD directive from the linker script generated by MCUXpresso, but it re-generates it at every build.