When computing the LOADADDR() of .data and .sdata, use:

LOADADDR(previous_section) + (ADDR(current_section) - ADDR(previous_section))

to avoid using SIZEOF(), which does not properly take into account
the size of orphans that might be sorted with the section.
This commit is contained in:
thorpej 2003-03-05 23:54:22 +00:00
parent 1fbc199e4e
commit 6689073e50

View File

@ -1,4 +1,4 @@
/* $NetBSD: ldscript.evbarm,v 1.1 2002/11/20 18:04:55 bsh Exp $ */
/* $NetBSD: ldscript.evbarm,v 1.2 2003/03/05 23:54:22 thorpej Exp $ */
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
"elf32-littlearm")
@ -32,14 +32,14 @@ SECTIONS
boundary. */
. = ALIGN(0x8000);
.data :
AT ((LOADADDR(.text) + SIZEOF(.text) + (0x8000 - 1)) & ~(0x8000 - 1))
AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
{
__data_start = . ;
*(.data)
*(.data.*)
}
.sdata :
AT (LOADADDR(.data) + SIZEOF(.data))
AT (LOADADDR(.data) + (ADDR(.sdata) - ADDR(.data)))
{
*(.sdata)
*(.sdata.*)