diff --git a/sys/arch/x68k/stand/boot/Makefile b/sys/arch/x68k/stand/boot/Makefile index 8c6f35bb85d2..de1304e13302 100644 --- a/sys/arch/x68k/stand/boot/Makefile +++ b/sys/arch/x68k/stand/boot/Makefile @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.1 2001/09/27 10:14:49 minoura Exp $ +# $NetBSD: Makefile,v 1.2 2001/09/27 14:08:27 minoura Exp $ + +.include BOOT= boot VERSION= 1.0 @@ -27,8 +29,11 @@ CPPFLAGS+= -I$M/stand/libiocs -I${COMMONDIR} CPPFLAGS+= -DTEXTADDR="0x${TEXT}" CPPFLAGS+= -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\" CFLAGS= -Wno-main -Os -m68020-60 - +.if ${OBJECT_FMT} == "ELF" LDFLAGS= -N -static -T ${.CURDIR}/boot.ldscript +.else +LDFLAGS= -N -static -Ttext ${TEXT} +.endif LIBIOCS!= cd $M/stand/libiocs && ${MAKE} print-objdir LIBSA!= cd $M/stand/libsa && ${MAKE} print-objdir LDLIBS= -L${LIBSA} -lsa -L${LIBIOCS} -liocs diff --git a/sys/arch/x68k/stand/boot_ufs/Makefile b/sys/arch/x68k/stand/boot_ufs/Makefile index 4519463c58c7..b948f8b19794 100644 --- a/sys/arch/x68k/stand/boot_ufs/Makefile +++ b/sys/arch/x68k/stand/boot_ufs/Makefile @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.2 2001/09/27 13:27:54 minoura Exp $ +# $NetBSD: Makefile,v 1.3 2001/09/27 14:08:27 minoura Exp $ + +.include BOOT= boot_ufs VERSION=1.0 @@ -32,8 +34,12 @@ CPPFLAGS+= -DSCSI_ADHOC_BOOTPART CPPFLAGS+= -DUSE_FFS #-DUSE_LFS CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} AFLAGS= ${CFLAGS:M-[ID]*} +.if ${OBJECT_FMT} == "ELF" LDFLAGS= -N -Bstatic -T ${.CURDIR}/${BOOT}.ldscript LDFLAGS+= -noinhibit-exec # XXX +.else +LDFLAGS= -n -Bstatic -Ttext ${TEXT} +.endif CLEANFILES= $(BOOT).x s.x x.s x.o diff --git a/sys/arch/x68k/stand/boot_ufs/boot.S b/sys/arch/x68k/stand/boot_ufs/boot.S index c460defa0437..bf1c8479fe26 100644 --- a/sys/arch/x68k/stand/boot_ufs/boot.S +++ b/sys/arch/x68k/stand/boot_ufs/boot.S @@ -2,7 +2,7 @@ | author: chapuni(GBA02750@niftyserve.or.jp) | Yasha | -| $NetBSD: boot.S,v 1.1 2001/09/27 10:14:49 minoura Exp $ +| $NetBSD: boot.S,v 1.2 2001/09/27 14:08:27 minoura Exp $ #include #include "iocscall.h" @@ -38,7 +38,7 @@ ASENTRY_NOPROFILE(entry0) #define ASRELOC(var) _RELOC(_ASM_LABEL(var)) #define RELOC(var) _RELOC(_C_LABEL(var)) - lea RELOC(__bss_start),%a1 + lea RELOC(edata),%a1 bra _ASM_LABEL(entry) | Disklabel= 404bytes diff --git a/sys/arch/x68k/stand/common/exec_image.S b/sys/arch/x68k/stand/common/exec_image.S index 6c7a4983ab58..07a6da04dfaa 100644 --- a/sys/arch/x68k/stand/common/exec_image.S +++ b/sys/arch/x68k/stand/common/exec_image.S @@ -1,4 +1,4 @@ -/* $NetBSD: exec_image.S,v 1.1 2001/09/27 10:14:50 minoura Exp $ */ +/* $NetBSD: exec_image.S,v 1.2 2001/09/27 14:08:28 minoura Exp $ */ /* * Copyright (c) 2001 Minoura Makoto. @@ -48,13 +48,13 @@ ENTRY_NOPROFILE(exec_image) /* copy the trampoline to the last physical page. */ moval LASTADDR,%sp | tmpstack from end of physmem - leal %sp@(-4096),%a3 | use last phys page as tramp + lea %sp@(-4096),%a3 | use last phys page as tramp movl #(end_trampoline-trampoline),%sp@- - peal %pc@(trampoline) - peal %a3@ + pea %pc@(trampoline) + pea %a3@ jbsr _C_LABEL(memcpy) | memcpy() is still alive - leal %sp@(12),%sp + lea %sp@(12),%sp jmp %a3@ | jump to tramp @@ -67,7 +67,7 @@ ASENTRY_NOPROFILE(trampoline) || %d7: boothowto movl %d5,%sp@- | push last arg (esym) movel LASTADDR,%sp@- | second arg (physsize) - peal %a5@ | first arg (firstpa) + pea %a5@ | first arg (firstpa) cmpl %a4,%a5 | if (l == x) beq L1 | copy not required