netwinder: fix base, minimize kern.ldscript diff with evbarm

New binutils align to 0x10000, not 0x8000 (which makes sense), so
adjust the base to be 0x10000 so that we are loaded at a page boundary
and (I guess) don't smash the firmware in the first page.  While here,
sync with ldscript.evbarm.

Makes my netwinder boot again.
This commit is contained in:
uwe 2023-12-18 23:12:43 +00:00
parent 9041b646df
commit a95547428c
1 changed files with 24 additions and 29 deletions

View File

@ -1,29 +1,45 @@
/* $NetBSD: kern.ldscript,v 1.10 2015/08/23 08:57:25 uebayasi Exp $ */
/* $NetBSD: kern.ldscript,v 1.11 2023/12/18 23:12:43 uwe Exp $ */
ENTRY(KERNEL_BASE_phys)
SECTIONS
{
KERNEL_BASE_phys = 0x00010000;
KERNEL_BASE_virt = 0xf0010000;
/* Kernel start: */
.start :
.start (KERNEL_BASE_phys) :
{
*(.start)
}
/* Read-only sections, merged into text segment: */
.text :
.text (KERNEL_BASE_virt + SIZEOF(.start)) :
AT (LOADADDR(.start) + SIZEOF(.start))
{
*(.text)
*(.text.*)
*(.stub)
*(.glue_7t) *(.glue_7)
*(.rodata) *(.rodata.*)
}
PROVIDE(__rodata_start = .);
.rodata :
{
*(.rodata)
*(.rodata.*)
. = ALIGN(64);
__CTOR_LIST__ = .;
*(.ctors)
*(.init_array)
__CTOR_END__ = .;
}
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
/* Adjust the address for the data segment to start on the next page
/* Adjust the address for the data segment to start on the next large page
boundary. */
. = ALIGN(0x8000);
. = ALIGN(0x10000);
.data :
{
__data_start = . ;
@ -35,6 +51,7 @@ SECTIONS
*(.sdata)
*(.sdata.*)
}
. = ALIGN(8);
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
@ -66,25 +83,3 @@ SECTIONS
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
PROVIDE (end = .);
}
SECTIONS
{
KERNEL_BASE_phys = 0x0000c000;
KERNEL_BASE_virt = 0xf000c000;
.start (KERNEL_BASE_phys) :
{
*(.start)
} =0
.text (KERNEL_BASE_virt + SIZEOF(.start)) :
AT (LOADADDR(.start) + SIZEOF(.start))
{
*(.text)
} =0
.data :
AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
{
*(.data)
}
}