This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Overlap error not generated for sections w/o content
- From: "Galit Heller" <Galit dot Heller at nsc dot com>
- To: binutils at sources dot redhat dot com
- Date: Sun, 11 Jan 2004 16:14:12 +0200
- Subject: Overlap error not generated for sections w/o content
Hi,
We use the following linker script excerpt to define the stack for CR16C
embedded systems:
.stack : { . += 0x600; }
since in our tool chain the input (ELF) files aren't comprised of .stack
sections.
If the linker script is erroneously written, so that the .stack load
address is set to a value which overlaps that of another output section,
no error is generated, since the SEC_ALLOC flag isn't set for .stack. E.g.
.data 0x1000 : { *(.data) }
.stack 0x1000 : { . += 600; }
does not cause an error nor a warning. Whereas if an output section data
expression (e.g. BYTE(0);) is used:
.stack 0x1000 : { BYTE(0); . += 0x600; }
then the following error is generated, and thus users get indication of a
problematic situation:
section .stack [0001000 -> 0001600] overlaps section .data [0001000 -> 0001200]
Should a linker hook function (e.g. ldemul_after_allocation) be used to
generate an error in such a case, or is there a chance that this behavior will
be changed ?
Regards,
Galit.