[U607-027] strange behaviour of orphaned output section placement when NOLOAD is used
Johannes Kliemann
kliemann@adacore.com
Fri Oct 1 14:20:10 GMT 2021
Hi everyone,
since there hasn't been any reply in the mean time I wanted to ask if there
are any updates on this issue?
To help clarifying the problem I added a reproducer. It consists of two units
defining one function each. Both of these functions are to be linked into the
.test section which is supposed to be located in the TESTRAM region as defined
in the test.ld linker script. Calling make will build an main file and create a
main.map mapping file. The mapping file shows that only function_1 is actually
located in that region while function_2 is located in a .test section that has
been automatically created in the ROM region. This behaviour only appears if
the .test section is defined with as NOLOAD.
Best regards,
Johannes Kliemann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 84 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20211001/591c794e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 192 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20211001/591c794e/attachment-0001.bin>
-------------- next part --------------
ENTRY(main)
MEMORY
{
ROM (RWXA) : ORIGIN = 0x10000000, LENGTH = 36K
RAM (RWXA) : ORIGIN = 0x20000000, LENGTH = 1K
TESTRAM (RWXA) : ORIGIN = 0x40000000, LENGTH = 1K
}
SECTIONS
{
/* Code sections, merged into text segment: */
/* ROM data ---------------------- */
.text : {} > ROM
.rodata : {} > ROM
__eabi = .;
/* internal SRAM data ------------ */
.bss : {} > RAM
.data : {} > RAM
.sdata : {} > RAM
.test (NOLOAD) : {} > TESTRAM
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unit.h
Type: text/x-chdr
Size: 77 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20211001/591c794e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unit2.c
Type: text/x-csrc
Size: 72 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20211001/591c794e/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unit1.c
Type: text/x-csrc
Size: 72 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20211001/591c794e/attachment-0004.bin>
More information about the Binutils
mailing list