Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/conf Add a linker script for the kernel. The...
details: https://anonhg.NetBSD.org/src/rev/797c29ab0619
branches: trunk
changeset: 379024:797c29ab0619
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed May 05 01:35:35 2021 +0000
description:
Add a linker script for the kernel. The main difference vs the
standard built-in for "ld -N" is to actually process the
.data.cacheline_aligned and .data.read_mostly sections correctly.
diffstat:
sys/arch/alpha/conf/Makefile.alpha | 4 +-
sys/arch/alpha/conf/kern.ldscript | 86 ++++++++++++++++++++++++++++++++++++++
2 files changed, 88 insertions(+), 2 deletions(-)
diffs (110 lines):
diff -r d0101a50896e -r 797c29ab0619 sys/arch/alpha/conf/Makefile.alpha
--- a/sys/arch/alpha/conf/Makefile.alpha Tue May 04 21:13:38 2021 +0000
+++ b/sys/arch/alpha/conf/Makefile.alpha Wed May 05 01:35:35 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.alpha,v 1.85 2018/09/22 12:24:01 rin Exp $
+# $NetBSD: Makefile.alpha,v 1.86 2021/05/05 01:35:35 thorpej Exp $
# Makefile for NetBSD
#
@@ -61,9 +61,9 @@ lock_stubs.o: assym.h
##
## (5) link settings
##
-LINKFORMAT= -N
TEXTADDR?= fffffc0000a00000
ENTRYPOINT= __transfer
+KERNLDSCRIPT?= ${ALPHA}/conf/kern.ldscript
EXTRA_LINKFLAGS= -G 4
STRIPFLAGS= -g -X
diff -r d0101a50896e -r 797c29ab0619 sys/arch/alpha/conf/kern.ldscript
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/alpha/conf/kern.ldscript Wed May 05 01:35:35 2021 +0000
@@ -0,0 +1,86 @@
+/* $NetBSD: kern.ldscript,v 1.1 2021/05/05 01:35:35 thorpej Exp $ */
+
+/*
+ * Linker script for the NetBSD/alpha kernel.
+ *
+ * This largely behaves the same as the standard elf64-alpha linker
+ * script for "ld -N"; the kernel is loaded into K0SEG, so there is
+ * no reason to page-align the .data segment.
+ */
+
+#include "assym.h" /* for COHERENCY_UNIT */
+
+OUTPUT_FORMAT("elf64-alpha", "elf64-alpha",
+ "elf64-alpha")
+OUTPUT_ARCH(alpha)
+SECTIONS
+{
+ .text :
+ {
+ *(.text)
+ *(.text.*)
+ *(.stub)
+ } =0x47ff041f
+ _etext = . ;
+ PROVIDE (etext = .);
+
+ .rodata :
+ {
+ *(.rodata .rodata.*)
+ }
+
+ .data :
+ {
+ *(.data)
+
+ . = ALIGN(COHERENCY_UNIT);
+ *(.data.cacheline_aligned)
+
+ . = ALIGN(COHERENCY_UNIT);
+ *(.data.read_mostly)
+
+ . = ALIGN(COHERENCY_UNIT);
+ *(.data.*)
+ }
+
+ /*
+ * Small-data located along side GOT and small-bss for
+ * GP-relative addressing.
+ */
+
+ .got :
+ {
+ *(.got)
+ }
+
+ .sdata :
+ {
+ *(.sdata .sdata.*)
+ }
+ _edata = . ;
+ PROVIDE (edata = .) ;
+
+ . = .;
+ __bss_start = .;
+ .sbss :
+ {
+ *(.sbss .sbss.*)
+ *(.scommon)
+ }
+
+ .bss :
+ {
+ *(.bss .bss.*)
+ *(COMMON)
+ }
+
+ /* End of the kernel image */
+ __kernel_end = . ;
+ _end = . ;
+ PROVIDE (end = .) ;
+
+ .note.netbsd.ident :
+ {
+ KEEP(*(.note.netbsd.ident));
+ }
+}
Home |
Main Index |
Thread Index |
Old Index