Add ELF support.

Thanks to Steve Woodford for his help!
This commit is contained in:
simonb 2001-01-02 04:28:37 +00:00
parent 472a75b08f
commit eaf4f43227
6 changed files with 26 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: BASALT,v 1.37 2000/09/24 15:59:31 jdolecek Exp $
# $NetBSD: BASALT,v 1.38 2001/01/02 04:28:37 simonb Exp $
#
# Kernel for basalt.og.org - thorpej's HP380 workstation.
#
@ -58,7 +58,6 @@ options COMPAT_HPUX # HP-UX binary compatibility
options COMPAT_M68K4K # m68k4k executables
options COMPAT_LINUX # Linux/m68k compatibility
options COMPAT_SVR4 # SVR4/m68k compatibility
options EXEC_ELF32 # ELF binaries
# Debugging options
options DIAGNOSTIC # Kernel sanity checks

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.63 2000/12/19 15:51:49 tsutsui Exp $
# $NetBSD: GENERIC,v 1.64 2001/01/02 04:28:37 simonb Exp $
#
# Generic kernel - one size fits all.
#
@ -6,7 +6,7 @@
# Include attributes common to all hp300s
include "arch/hp300/conf/std.hp300"
#ident "GENERIC-$Revision: 1.63 $"
#ident "GENERIC-$Revision: 1.64 $"
# Support for various CPU types
options HP320
@ -89,11 +89,11 @@ options SE_KEYBOARD # include Swedish HIL keymap
#
options COMPAT_HPUX # HP-UX binary compatibility
options COMPAT_AOUT_M68K # compatibility with NetBSD/m68k a.out
options COMPAT_M68K4K # compat. with NetBSD/m68k4k binaries
#options COMPAT_LINUX # Linux/m68k binary compatibility
#options COMPAT_SVR4 # SVR4 binary compatibility
#options EXEC_ELF32 # 32-bit ELF executables (Linux, SVR4)
# Debugging options
options DIAGNOSTIC # Extra kernel sanity checks

View File

@ -1,4 +1,4 @@
# $NetBSD: files.hp300,v 1.42 2000/03/14 15:56:54 oster Exp $
# $NetBSD: files.hp300,v 1.43 2001/01/02 04:28:38 simonb Exp $
#
# hp300-specific configuration info
@ -212,6 +212,9 @@ file dev/cninit.c
include "compat/hpux/files.hpux"
file arch/hp300/hp300/hpux_machdep.c compat_hpux
# NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K)
include "compat/aoutm68k/files.aoutm68k"
# SVR4 Binary Compatibility (COMPAT_SVR4)
include "compat/svr4/files.svr4"

View File

@ -1,4 +1,4 @@
# $NetBSD: std.hp300,v 1.7 2000/06/22 20:27:52 fvdl Exp $
# $NetBSD: std.hp300,v 1.8 2001/01/02 04:28:38 simonb Exp $
#
# Options/devices that all hp300s should have
#
@ -6,4 +6,5 @@
machine hp300 m68k
options EXEC_AOUT # support for exec'ing a.out
options EXEC_ELF32 # support for exec'ing ELF
options EXEC_SCRIPT # support for #! scripts

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.143 2000/09/13 15:00:18 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.144 2001/01/02 04:28:38 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -73,9 +73,14 @@
#include <sys/kcore.h>
#include <sys/vnode.h>
#ifdef DDB
#include <machine/db_machdep.h>
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
#ifdef __ELF__
#include <sys/exec_elf.h>
#endif
#endif /* DDB */
#include <machine/autoconf.h>
#include <machine/bootinfo.h>
@ -273,7 +278,12 @@ consinit()
extern int end;
extern int *esym;
#ifndef __ELF__
ddb_init(*(int *)&end, ((int *)&end) + 1, esym);
#else
ddb_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
(void *)&end, esym);
#endif
}
if (boothowto & RB_KDB)
Debugger();

View File

@ -1,4 +1,8 @@
/* $NetBSD: db_machdep.h,v 1.2 1994/10/26 07:26:21 cgd Exp $ */
/* $NetBSD: db_machdep.h,v 1.3 2001/01/02 04:28:38 simonb Exp $ */
/* Just use the common m68k definition */
#include <m68k/db_machdep.h>
#undef DB_AOUT_SYMBOLS
#define DB_ELF_SYMBOLS
#define DB_ELFSIZE 32