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."
This commit is contained in:
thorpej
2002-11-05 06:08:29 +00:00
parent 10b8b2f790
commit ec11878985

View File

@@ -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 <sys/cdefs.h>
#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);