summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasper <jasper@openbsd.org>2013-06-05 01:09:09 +0000
committerjasper <jasper@openbsd.org>2013-06-05 01:09:09 +0000
commit60026ac0ddc3edb9a564a0d2edd25eb83cd3fd78 (patch)
tree29f2548fcc79b6bbad7e5adbf1c3387f51300c75
parentadd WIP second stage bootloader for octeon; far from working and contains many stubs still. (diff)
downloadwireguard-openbsd-60026ac0ddc3edb9a564a0d2edd25eb83cd3fd78.tar.xz
wireguard-openbsd-60026ac0ddc3edb9a564a0d2edd25eb83cd3fd78.zip
ditch local ld.script and use conf/ld.script instead, and adjust entry
point accordingly.
-rw-r--r--sys/arch/octeon/stand/boot/Makefile.inc6
-rw-r--r--sys/arch/octeon/stand/boot/ld.script23
-rw-r--r--sys/arch/octeon/stand/boot/start.S10
3 files changed, 8 insertions, 31 deletions
diff --git a/sys/arch/octeon/stand/boot/Makefile.inc b/sys/arch/octeon/stand/boot/Makefile.inc
index 888d8633c07..08e239a5fbf 100644
--- a/sys/arch/octeon/stand/boot/Makefile.inc
+++ b/sys/arch/octeon/stand/boot/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.1 2013/06/05 01:02:29 jasper Exp $
+# $OpenBSD: Makefile.inc,v 1.2 2013/06/05 01:09:09 jasper Exp $
NOMAN=
S= ${.CURDIR}/../../../..
@@ -9,8 +9,8 @@ CPPFLAGS+= ${SAABI} -mno-abicalls -D_NO_ABICALLS -Werror \
-I${S} -I${S}/lib/libsa \
-I${.OBJDIR} -I${BOOTDIR}
-LDSCRIPT= ${.CURDIR}/ld.script
-LDFLAGS+= ${SALDFLAGS} -T ${LDSCRIPT} -Ttext=0xffffffff81000000 -e start
+LDSCRIPT= ${.CURDIR}/../../conf/ld.script
+LDFLAGS+= ${SALDFLAGS} -T ${LDSCRIPT} -Ttext=0xffffffff81000000 -e __start
AFLAGS+= ${SAABI}
diff --git a/sys/arch/octeon/stand/boot/ld.script b/sys/arch/octeon/stand/boot/ld.script
deleted file mode 100644
index eaf67e0bb74..00000000000
--- a/sys/arch/octeon/stand/boot/ld.script
+++ /dev/null
@@ -1,23 +0,0 @@
-OUTPUT_FORMAT("elf64-tradbigmips")
-OUTPUT_ARCH(mips)
-ENTRY(start)
-
-SECTIONS
-{
- .text : { *(.text .text.* .gnu.linkonce.t.*) }
- PROVIDE (etext = .);
- .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
- _gp = ALIGN(16) + 0x7ff0;
- .data : { *(.data .data.* .gnu.linkonce.d.*) }
- PROVIDE (edata = .);
- .sbss : { *(.sbss .sbss.* .gnu.linkonce.sb.* .scommon) }
- .bss : { *(.bss .bss.* .gnu.linkonce.b.* COMMON) }
- PROVIDE (_end = .);
- PROVIDE (end = .);
- /DISCARD/ :
- {
- *(.pdr)
- *(.mdebug.abi64)
- *(.MIPS.options)
- }
-}
diff --git a/sys/arch/octeon/stand/boot/start.S b/sys/arch/octeon/stand/boot/start.S
index 570a42cf818..136ab44f0b1 100644
--- a/sys/arch/octeon/stand/boot/start.S
+++ b/sys/arch/octeon/stand/boot/start.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: start.S,v 1.1 2013/06/05 01:02:29 jasper Exp $ */
+/* $OpenBSD: start.S,v 1.2 2013/06/05 01:09:09 jasper Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -35,10 +35,10 @@
.set noreorder
.set mips64r2
- .globl start
+ .globl __start
.globl kernel_text
-kernel_text = start
-start:
+kernel_text = __start
+__start:
/* initialize ebase */
dla t0, 0xffffffff80000000
mtc0 t0, COP_0_EBASE
@@ -67,7 +67,7 @@ start:
/*
* Initialize stack and call bootloader setup.
*/
- LA t0, start - FRAMESZ(CF_SZ)
+ LA t0, __start - FRAMESZ(CF_SZ)
PTR_S ra, CF_RA_OFFS(t0) # save uboot return address
PTR_S sp, 0(t0) # and stack
move sp, t0