From ec11878985a50c4ae9b4c942da58b31ba24ca8af Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 5 Nov 2002 06:08:29 +0000 Subject: [PATCH] For ELF, set d->loadaddr to 0, as we do for a.out. On both my 4000/60 and SIMH, a boot program NOT loaded at 0 consistently is loaded +0x5200 too high in memory, which which causes a fatal trap back into the console even before the self-relocating code can run. "wHATEver." --- common/file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/file.c b/common/file.c index 86fd3fb..4ae3475 100644 --- a/common/file.c +++ b/common/file.c @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.9 2002/06/06 22:52:25 thorpej Exp $ */ +/* $NetBSD: file.c,v 1.10 2002/11/05 06:08:29 thorpej Exp $ */ /* * Copyright (c) 1995-96 Mats O Jansson. All rights reserved. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: file.c,v 1.9 2002/06/06 22:52:25 thorpej Exp $"); +__RCSID("$NetBSD: file.c,v 1.10 2002/11/05 06:08:29 thorpej Exp $"); #endif #include "os.h" @@ -521,7 +521,7 @@ GetElfFileInfo(dl) } dl->image_type = IMAGE_TYPE_ELF32; - dl->loadaddr = e_entry; /* We assume the standalone program */ + dl->loadaddr = 0; dl->xferaddr = e_entry; /* will relocate itself if necessary */ if (e_phnum > SEC_MAX) @@ -1068,6 +1068,9 @@ mopFileRead(dlslot, buf) dlslot->a_lseek = pos; break; + + default: + abort(); } return(len);