Module Name: src
Committed By: reinoud
Date: Fri Aug 17 20:16:07 UTC 2018
Modified Files:
src/sys/arch/usermode/conf: Makefile.usermode kern.ldscript
Log Message:
Start using the kernel ld script.
There are still issues with the .init placement and ./build.sh creating bad
images.
To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/usermode/conf/Makefile.usermode
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/usermode/conf/kern.ldscript
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/usermode/conf/Makefile.usermode
diff -u src/sys/arch/usermode/conf/Makefile.usermode:1.42 src/sys/arch/usermode/conf/Makefile.usermode:1.43
--- src/sys/arch/usermode/conf/Makefile.usermode:1.42 Fri Jun 1 07:22:33 2018
+++ src/sys/arch/usermode/conf/Makefile.usermode Fri Aug 17 20:16:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.usermode,v 1.42 2018/06/01 07:22:33 reinoud Exp $
+# $NetBSD: Makefile.usermode,v 1.43 2018/08/17 20:16:07 reinoud Exp $
MKCTF?= no
USETOOLS?= no
@@ -74,9 +74,9 @@ KERNLDSCRIPT?= ${USERMODE}/conf/kern.lds
SYSTEM_LD= @do_system_ld() { \
${_MKSHMSG} " link ${.CURDIR:T}/${.TARGET}"; \
${_MKSHECHO}\
- ${CC} -static ${COPTS} -Wl,-Map,$${target}.map -o ${.TARGET} ${LINKFORMAT} -Ttext ${TEXTADDR} '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o ${USERMODE_LIBS} $$@; \
+ ${CC} -static ${COPTS} -Wl,-Map,$${target}.map -o ${.TARGET} ${LINKFORMAT} -Wl,-Ttext,${TEXTADDR} '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o netbsd.ldscript ${USERMODE_LIBS} $$@; \
${SYSTEM_LD_FIX} \
- ${CC} -static ${COPTS} -Wl,-Map,$${target}.map -o ${.TARGET} ${LINKFORMAT} -Ttext ${TEXTADDR} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o ${USERMODE_LIBS} $$@; \
+ ${CC} -static ${COPTS} -Wl,-Map,$${target}.map -o ${.TARGET} ${LINKFORMAT} -Wl,-Ttext,${TEXTADDR} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o netbsd.ldscript ${USERMODE_LIBS} $$@; \
}; \
do_system_ld
NVFLAGS= -n
Index: src/sys/arch/usermode/conf/kern.ldscript
diff -u src/sys/arch/usermode/conf/kern.ldscript:1.1 src/sys/arch/usermode/conf/kern.ldscript:1.2
--- src/sys/arch/usermode/conf/kern.ldscript:1.1 Fri May 18 19:04:10 2018
+++ src/sys/arch/usermode/conf/kern.ldscript Fri Aug 17 20:16:07 2018
@@ -1,20 +1,28 @@
-/* $NetBSD: kern.ldscript,v 1.1 2018/05/18 19:04:10 reinoud Exp $ */
+/* $NetBSD: kern.ldscript,v 1.2 2018/08/17 20:16:07 reinoud Exp $ */
#include "assym.h"
+__PAGE_SIZE = 0x1000 ;
+
ENTRY(_start)
SECTIONS
{
/* Read-only sections, merged into text segment: */
.text :
{
+ . = ALIGN(__PAGE_SIZE);
+ *(.text.user)
+ . = ALIGN(__PAGE_SIZE);
*(.text)
*(.text.*)
*(.stub)
- }
+ . = ALIGN(__PAGE_SIZE);
+ } =0xCC
+
_etext = . ;
PROVIDE (etext = .) ;
+ . = ALIGN(__PAGE_SIZE);
.rodata :
{
*(.rodata)
@@ -25,7 +33,7 @@ SECTIONS
* Adjust the address for the data segment. We want to adjust up to
* the same address within the page on the next page up.
*/
- . = ALIGN(0x100000) + (. & (0x100000 - 1));
+ . = ALIGN(__PAGE_SIZE);
__data_start = . ;
.data :
{
@@ -52,22 +60,17 @@ SECTIONS
*(.bss)
*(.bss.*)
*(COMMON)
- . = ALIGN(64 / 8);
}
- . = ALIGN(64 / 8);
+
+ . = ALIGN(__PAGE_SIZE);
_end = . ;
PROVIDE (end = .) ;
- .note.netbsd.ident :
- {
- KEEP(*(.note.netbsd.ident));
- }
-}
-SECTIONS
-{
- .text :
- AT (ADDR(.text) & 0x0fffffff)
- {
- *(.text)
- } = 0
+ /*
+ * .note.netbsd.ident :
+ * {
+ * KEEP(*(.note.netbsd.ident));
+ * }
+ */
}
+