From fb6a32c2912aeedcccd7059407d495ad4a6e1421 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Sun, 11 Aug 2002 23:11:23 +0000 Subject: 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. --- sys/arch/sparc/stand/bootxx/Makefile | 13 +++++++++---- sys/arch/sparc/stand/bootxx/bootxx.c | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'sys/arch/sparc/stand/bootxx') 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; /* -- cgit v1.2.3