summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-09-03 16:39:38 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-09-03 16:39:38 +0000
commit4ba646015cb2f152ee637edfbe3c91fdd12b2354 (patch)
tree4f6f6bfca6fd8a7e25dadc12a882f13c27b5184b
parent05675b9ff7cc7b075ebcf22a3c5c9ca8c607d1e2 (diff)
The sparc64 boot block currently compares a memory address to the ELF magic
and complains if they do not match. Instead, load the start of the ELF header from memory and complain if this does not match the ELF magic. Tested by kettenis@ ok miod@
-rw-r--r--sys/arch/sparc64/stand/bootblk/bootblk.fth8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/sparc64/stand/bootblk/bootblk.fth b/sys/arch/sparc64/stand/bootblk/bootblk.fth
index b20efd3a3f1..4d216e60562 100644
--- a/sys/arch/sparc64/stand/bootblk/bootblk.fth
+++ b/sys/arch/sparc64/stand/bootblk/bootblk.fth
@@ -1,4 +1,4 @@
-\ $OpenBSD: bootblk.fth,v 1.3 2003/08/28 23:47:31 jason Exp $
+\ $OpenBSD: bootblk.fth,v 1.4 2009/09/03 16:39:37 jsing Exp $
\ $NetBSD: bootblk.fth,v 1.3 2001/08/15 20:10:24 eeh Exp $
\
\ IEEE 1275 Open Firmware Boot Block
@@ -603,7 +603,11 @@ h# 6000 constant loader-base
loader-base ( buf-len addr )
2dup read-file ( buf-len addr )
ufs-close ( buf-len addr )
- dup is-elf? if ." load-file: not an elf executable" cr abort then
+
+ dup l@ is-elf? false = if
+ ." load-file: not an elf executable" cr
+ abort
+ then
\ Luckily the prom should be able to handle ELF executables by itself