summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/stand/bootxx
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-08-11 23:11:23 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-08-11 23:11:23 +0000
commitfb6a32c2912aeedcccd7059407d495ad4a6e1421 (patch)
tree672650a8219bca690a2ac97afbb746a902db97b3 /sys/arch/sparc/stand/bootxx
parent1c9a674781a04c62693d9e96cee8c3d61d7270bb (diff)
ELF support in sparc bootblocks.
Loadfile is from alpha, but heaviliy hacked here. The build is done by building elf versions of boot and bootxx, then merging the .rodata and .text sections into .text with a horrible hack and then using objcopy to convert that into a.out. Maybe someone will want to fix installboot to deal with ELF instead, but I won't be that someone in the nearest future.
Diffstat (limited to 'sys/arch/sparc/stand/bootxx')
-rw-r--r--sys/arch/sparc/stand/bootxx/Makefile13
-rw-r--r--sys/arch/sparc/stand/bootxx/bootxx.c4
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/arch/sparc/stand/bootxx/Makefile b/sys/arch/sparc/stand/bootxx/Makefile
index 3b07e62213c..a991b929284 100644
--- a/sys/arch/sparc/stand/bootxx/Makefile
+++ b/sys/arch/sparc/stand/bootxx/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.5 1997/09/17 10:46:16 downsj Exp $
+# $OpenBSD: Makefile,v 1.6 2002/08/11 23:11:22 art Exp $
# $NetBSD: Makefile,v 1.2 1995/09/30 21:43:38 pk Exp $
.PATH: ${.CURDIR}/../common
@@ -9,6 +9,7 @@ NOMAN= noman
INSTALL_STRIP=
SRCS= srt0.S bootxx.c closeall.c dvma.c promdev.c
+CLEANFILES+=${PROG}.aout ${PROG}.elf
# pre-built bits of libkern
KOBJS= __main.o bzero.o urem.o udiv.o
@@ -21,9 +22,13 @@ CFLAGS= -O2 -I${.CURDIR}/../common -I${.CURDIR}/../../../../arch \
-I${.CURDIR}/../../../.. -I${.CURDIR}/../../../../lib/libsa -DBOOTXX \
${DEFS}
-${PROG}: ${OBJS}
- ${LD} -N -T ${RELOC} -e start ${OBJS} ${_SOBJS} ${_KOBJS}
- # convert to Sun magic
+elfclean: clean-elf.c
+ ${HOSTCC} -o elfclean ${.ALLSRC}
+
+${PROG}: ${OBJS} elfclean
+ ${LD} -N -Ttext ${RELOC} -e start ${OBJS} ${_SOBJS} ${_KOBJS} -o elf
+ ./elfclean elf
+ objcopy -j .text -j .data -j .bss -O a.out-sparc-netbsd elf a.out
@size a.out
(echo -n 01 | tr 01 '\01\03'; tail +3c a.out) > ${.TARGET}
@rm a.out
diff --git a/sys/arch/sparc/stand/bootxx/bootxx.c b/sys/arch/sparc/stand/bootxx/bootxx.c
index 2b9325548fe..d7bf507c753 100644
--- a/sys/arch/sparc/stand/bootxx/bootxx.c
+++ b/sys/arch/sparc/stand/bootxx/bootxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootxx.c,v 1.2 2002/03/14 01:26:44 millert Exp $ */
+/* $OpenBSD: bootxx.c,v 1.3 2002/08/11 23:11:22 art Exp $ */
/* $NetBSD: bootxx.c,v 1.2 1997/09/14 19:28:17 pk Exp $ */
/*
@@ -45,7 +45,7 @@ int netif_debug;
/*
* Boot device is derived from ROM provided information.
*/
-const char progname[] = "bootxx";
+char progname[] = "bootxx";
struct open_file io;
/*