Preserve the symbol table in the LKM || KSYMS cases also.

This commit is contained in:
ragge 2003-04-27 10:42:48 +00:00
parent e13853c3cc
commit 1989d659bb
19 changed files with 73 additions and 44 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: start.c,v 1.2 2002/03/24 23:37:42 bjh21 Exp $ */
/* $NetBSD: start.c,v 1.3 2003/04/27 10:42:48 ragge Exp $ */
/*-
* Copyright (c) 1998, 2000 Ben Harris
* All rights reserved.
@ -31,7 +31,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.2 2002/03/24 23:37:42 bjh21 Exp $");
__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.3 2003/04/27 10:42:48 ragge Exp $");
#include <sys/msgbuf.h>
#include <sys/user.h>
@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: start.c,v 1.2 2002/03/24 23:37:42 bjh21 Exp $");
#include "arcvideo.h"
#include "ioc.h"
#include "ksyms.h"
#if NIOC > 0
#include <arch/acorn26/iobus/iocreg.h>
@ -139,7 +140,7 @@ start(initbootconfig)
panic("Bootloader mislaid the data segment");
#endif
#ifndef DDB
#if !NKSYMS && !defined(DDB) && !defined(LKM)
/* Throw away the symbol table to gain space. */
if (bootconfig.freebase == bootconfig.esym) {
bootconfig.freebase = bootconfig.ssym;

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.10 2003/03/18 16:40:18 matt Exp $ */
/* $NetBSD: locore.S,v 1.11 2003/04/27 10:42:49 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -39,6 +39,7 @@
#include "opt_multiprocessor.h"
#include "opt_ppcparam.h"
#include "assym.h"
#include "ksyms.h"
#include <sys/syscall.h>
@ -148,7 +149,7 @@ __start_cpu1_loop:
__start_cpu0:
/* compute end of kernel memory */
#if defined(DDB) || defined(KERNFS)
#if defined(DDB) || defined(KERNFS) || NKSYMS || defined(LKM)
lis 7,_C_LABEL(startsym)@ha
addi 7,7,_C_LABEL(startsym)@l
stw 3,0(7)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.8 2003/04/08 22:57:55 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.9 2003/04/27 10:42:49 ragge Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -49,6 +49,7 @@
#include "opt_ddb.h"
#include "opt_fpsp.h"
#include "ksyms.h"
#include "assym.h"
#include <machine/asm.h>
#include <machine/trap.h>
@ -209,7 +210,7 @@ Lmemok:
movl %d1,%a0@ | and physmem
/* configure kernel and lwp0 VA space so we can get going */
.globl _Sysseg, _pmap_bootstrap, _avail_start
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel test/data/syms
movl %a0@,%d5
jne Lstart2

View File

@ -1,4 +1,4 @@
/* $NetBSD: ev64260_locore.S,v 1.4 2003/03/24 17:07:17 matt Exp $ */
/* $NetBSD: ev64260_locore.S,v 1.5 2003/04/27 10:42:50 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -218,7 +218,7 @@ __start:
/* compute end of kernel memory */
lis 8,_C_LABEL(end)@ha
addi 8,8,_C_LABEL(end)@l
#if defined(DDB) || defined(KERNFS)
#if NKSYMS || defined(DDB) || defined(LKM) || defined(KERNFS)
lis 7,_C_LABEL(startsym)@ha
addi 7,7,_C_LABEL(startsym)@l
stw 3,0(7)

View File

@ -1,4 +1,4 @@
/* $NetBSD: walnut_start.S,v 1.6 2003/03/11 10:40:17 hannken Exp $ */
/* $NetBSD: walnut_start.S,v 1.7 2003/04/27 10:42:50 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -76,6 +76,7 @@
#include "opt_ppcarch.h"
#include "opt_ppcparam.h"
#include "assym.h"
#include "ksyms.h"
#include <sys/syscall.h>
@ -188,7 +189,7 @@ __start_cpu0:
cmpw 3,8
bne+ 2b
#if defined(DDB)
#if NKSYMS || defined(DDB) || defined(LKM)
/* If we had symbol table location we'd store it here and would've adjusted r8 here */
lis 7,_C_LABEL(startsym)@ha
addi 7,7,_C_LABEL(startsym)@l

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.129 2003/04/08 22:57:55 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.130 2003/04/27 10:42:50 ragge Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -60,6 +60,8 @@
#include <hp300/hp300/leds.h>
#endif
#include "ksyms.h"
#define MMUADDR(ar) movl _C_LABEL(MMUbase),ar
#define CLKADDR(ar) movl _C_LABEL(CLKbase),ar
@ -369,7 +371,7 @@ Lstart2:
movl %d1,%a0@ | and physmem
/* configure kernel and lwp0 VA space so we can get going */
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel test/data/syms
movl %a0@,%d5
jne Lstart3

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.17 2003/04/08 22:57:55 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.18 2003/04/27 10:42:50 ragge Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -52,6 +52,8 @@
#include <machine/asm.h>
#include <machine/trap.h>
#include "ksyms.h"
#define PRINT(msg) \
pea 9f ; \
jbsr _C_LABEL(printf); \
@ -208,7 +210,7 @@ Lstart2:
RELOC(physmem,%a0)
movl %d1,%a0@ | and physmem
/* configure kernel and lwp0 VA space so we can get going */
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel test/data/syms
movl %a0@,%d2
jne Lstart3

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.91 2003/04/08 22:57:57 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.92 2003/04/27 10:42:51 ragge Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -54,6 +54,7 @@
#include <machine/asm.h>
#include <machine/trap.h>
#include "ksyms.h"
/*
* Temporary stack for a variety of purposes.
@ -554,7 +555,7 @@ Lstart1:
/*
* configure kernel and lwp0 VA space so we can get going
*/
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel text/data syms
movl %a0@,%d2
jne Lstart2

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.3 2003/03/18 16:40:21 matt Exp $ */
/* $NetBSD: locore.S,v 1.4 2003/04/27 10:42:51 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -52,6 +52,8 @@
#include <powerpc/spr.h>
#include "ksyms.h"
/*
* Some instructions gas doesn't understand (yet?)
*/
@ -109,7 +111,7 @@ __start:
isync
/* compute end of kernel memory */
#if defined(DDB) || defined(KERNFS)
#if NKSYMS || defined(DDB) || defined(LKM) || defined(KERNFS)
lis %r7,_C_LABEL(startsym)@ha
addi %r7,%r7,_C_LABEL(startsym)@l
stw %r3,0(%r7)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.30 2003/04/08 22:57:57 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.31 2003/04/27 10:42:51 ragge Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -58,6 +58,7 @@
#include <machine/asm.h>
#include <machine/trap.h>
#include "ksyms.h"
/*
* Temporary stack for a variety of purposes.
@ -151,7 +152,7 @@ ASENTRY_NOPROFILE(start)
movl %a0@(188),_ASM_LABEL(monitor)| save trap #15 to return PROM monitor
RELOC(esym, %a0)
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
movl %d2,%a0@ | store end of symbol table
#else
clrl %a0@
@ -327,7 +328,7 @@ Lstart1:
*/
.globl _Sysseg, _pmap_bootstrap, _avail_start
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel test/data/syms
movl %a0@,%d2
jne Lstart2

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.39 2003/04/08 22:57:57 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.40 2003/04/27 10:42:51 ragge Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
@ -65,6 +65,8 @@
#error "M68040 is not defined! (check that the generated assym.h is not empty)"
#endif
#include "ksyms.h"
/*
* This is for kvm_mkdb, and should be the address of the beginning
* of the kernel text segment (not necessarily the same as kernbase).
@ -263,7 +265,7 @@ Lstart2:
movc %d0,%sfc | as source
movc %d0,%dfc | and destination of transfers
/* configure kernel and lwp0 VA space so we can get going */
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel test/data/syms
movl %a0@,%d5
jne Lstart3

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.31 2003/02/03 17:09:59 matt Exp $ */
/* $NetBSD: locore.S,v 1.32 2003/04/27 10:42:52 ragge Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -49,6 +49,8 @@
#include <powerpc/spr.h>
#include "ksyms.h"
/*
* Some instructions gas doesn't understand (yet?)
*/
@ -90,7 +92,7 @@ __start:
isync
/* compute end of kernel memory */
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
/* skip symbol table */
cmpwi 6,0
beq 1f

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.4 2003/02/03 17:10:00 matt Exp $ */
/* $NetBSD: locore.S,v 1.5 2003/04/27 10:42:52 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -53,6 +53,8 @@
#include <powerpc/spr.h>
#include <powerpc/oea/hid.h>
#include "ksyms.h"
/*
* Some instructions gas doesn't understand (yet?)
*/
@ -95,7 +97,7 @@ __start:
*/
/* compute end of kernel memory */
#if defined(DDB) || defined(KERNFS)
#if NKSYMS || defined(DDB) || defined(LKM) || defined(KERNFS)
lis 7,_C_LABEL(startsym)@ha
addi 7,7,_C_LABEL(startsym)@l
stw 3,0(7)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.5 2003/03/18 16:40:24 matt Exp $ */
/* $NetBSD: locore.S,v 1.6 2003/04/27 10:42:52 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -51,6 +51,8 @@
#include <powerpc/spr.h>
#include "ksyms.h"
/*
* Some instructions gas doesn't understand (yet?)
*/
@ -113,7 +115,7 @@ __start:
isync
/* compute end of kernel memory */
#if defined(DDB) || defined(KERNFS)
#if NKSYMS || defined(DDB) || defined(LKM) || defined(KERNFS)
lis 7,_C_LABEL(startsym)@ha
addi 7,7,_C_LABEL(startsym)@l
stw 3,0(7)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.7 2003/03/18 16:40:25 matt Exp $ */
/* $NetBSD: locore.S,v 1.8 2003/04/27 10:42:52 ragge Exp $ */
/* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */
/*
@ -52,6 +52,8 @@
#include <powerpc/spr.h>
#include <powerpc/oea/hid.h>
#include "ksyms.h"
/*
* Some instructions gas doesn't understand (yet?)
*/
@ -118,7 +120,7 @@ __start:
mtspr 1008,8
/* compute end of kernel memory */
#if defined(DDB) || defined(KERNFS)
#if NKSYMS || defined(DDB) || defined(LKM) || defined(KERNFS)
lis 7,_C_LABEL(startsym)@ha
addi 7,7,_C_LABEL(startsym)@l
stw 3,0(7)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.174 2003/04/04 21:35:39 petrov Exp $ */
/* $NetBSD: locore.s,v 1.175 2003/04/27 10:42:53 ragge Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath
@ -93,6 +93,8 @@
#include <machine/pmap.h>
#include <machine/asm.h>
#include "ksyms.h"
/* A few convenient abbreviations for trapframe fields. */
#define TF_G TF_GLOBAL
#define TF_O TF_OUT
@ -5371,7 +5373,7 @@ dostart:
wrpr %g0, 13, %pil
wrpr %g0, PSTATE_INTR|PSTATE_PEF, %pstate
wr %o0, FPRS_FEF, %fprs ! Turn on FPU
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
/*
* First, check for DDB arguments. A pointer to an argument
* is passed in %o1 who's length is passed in %o2. Our
@ -11944,7 +11946,7 @@ ENTRY(OF_val2sym32)
.data
_ALIGN
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
.globl _C_LABEL(esym)
_C_LABEL(esym):
POINTER 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore2.c,v 1.9 2003/04/01 15:47:48 thorpej Exp $ */
/* $NetBSD: locore2.c,v 1.10 2003/04/27 10:42:53 ragge Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -63,6 +63,8 @@
#include <sun2/sun2/machdep.h>
#include <sun68k/sun68k/vector.h>
#include "ksyms.h"
/* This is defined in locore.s */
extern char kernel_text[];
@ -106,11 +108,11 @@ void _bootstrap __P((void));
static void _verify_hardware __P((void));
static void _vm_init __P((void));
#if defined(DDB)
#if NKSYMS || defined(DDB) || defined(LKM)
static void _save_symtab __P((void));
/*
* Preserve DDB symbols and strings by setting esym.
* Preserve symbols and strings by setting esym.
*/
static void
_save_symtab()
@ -174,7 +176,7 @@ _vm_init()
* if DDB is not part of this kernel, ignore the symbols.
*/
esym = end + 4;
#if defined(DDB)
#if NKSYMS || defined(DDB) || defined(LKM)
/* This will advance esym past the symbols. */
_save_symtab();
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore2.c,v 1.81 2003/01/18 07:03:35 thorpej Exp $ */
/* $NetBSD: locore2.c,v 1.82 2003/04/27 10:43:27 ragge Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -63,6 +63,8 @@
#include <sun3/sun3/obmem.h>
#include <sun3/sun3/vector.h>
#include "ksyms.h"
/* This is defined in locore.s */
extern char kernel_text[];
@ -108,7 +110,7 @@ void _bootstrap __P((void));
static void _verify_hardware __P((void));
static void _vm_init __P((void));
#if defined(DDB)
#if NKSYMS || defined(DDB) || defined(LKM)
static void _save_symtab __P((void));
/*
@ -189,7 +191,7 @@ _vm_init()
* if DDB is not part of this kernel, ignore the symbols.
*/
esym = end + 4;
#if defined(DDB)
#if NKSYMS || defined(DDB) || defined(LKM)
/* This will advance esym past the symbols. */
_save_symtab();
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.70 2003/04/08 22:57:58 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.71 2003/04/27 10:42:54 ragge Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -54,6 +54,7 @@
#include "fd.h"
#include "par.h"
#include "assym.h"
#include "ksyms.h"
#include <machine/asm.h>
@ -817,7 +818,7 @@ Lstart1:
RELOC(physmem, %a0)
movl %d1,%a0@ | and physmem
/* configure kernel and lwp0 VA space so we can get going */
#ifdef DDB
#if NKSYMS || defined(DDB) || defined(LKM)
RELOC(esym,%a0) | end of static kernel test/data/syms
movl %a0@,%d5
jne Lstart2