In an embedded environment i want to convey information about a special part of memory (start address and length) from the build process to the program loader. My idea is to let linker create an output section similar to .bss, i.e. that section should not occupy space in the elf file and should have flags like the .bss section. I came to this idea since i am already using a customized linker script.
When processing the elf file, my costumized loader could recognize this section by a magic name and use the sections size and VMA as the description for the special part of memory.
When i say it should be similar to .bss, i mean the output of objdump -h
should be similar to this:
Sections:
Idx Name Size VMA LMA File off Algn
...
7 .bss 00000204 10204c9c 10204c9c 00005c40 2**2
ALLOC
...
I guess it is important that here only the flag ALLOC is present, but not LOAD or CONTENTS.
Can this be achieved with some instructions in the linker script? If so, what are those instructions?