summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_aout.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-01-25 21:40:47 +0000
committerbde <bde@FreeBSD.org>1995-01-25 21:40:47 +0000
commit802677cea866a1db7729c2a2ce5668570d364062 (patch)
tree0fe59a9f89cd6b9339c628dc3655fff907c49212 /sys/ddb/db_aout.c
parent152d1bd214d432fa6ecbdc6c6308ce3d2356aaa1 (diff)
downloadFreeBSD-src-802677cea866a1db7729c2a2ce5668570d364062.zip
FreeBSD-src-802677cea866a1db7729c2a2ce5668570d364062.tar.gz
Load the kernel symbol table in the boot loader and not at compile time.
(Boot with the -D flag if you want symbols.) Make it easier to extend `struct bootinfo' without losing either forwards or backwards compatibility. ddb_aout.c: Get the symbol table from wherever the loader put it. Nuke db_symtab[SYMTAB_SPACE]. boot.c: Enable loading of symbols. Align them on a page boundary. Add printfs about the symbol table sizes. Pass the memory sizes to the kernel. Fix initialization of `unit' (it got moved out of the loop). Fix adding the bss size (it got moved inside an ifdef). Initialize serial port when RB_SERIAL is toggled on. Fix comments. Clean up formatting of recently added code. io.c: Clean up formatting of recently added code. netboot/main.c, machdep.c, wd.c: Change names of bootinfo fields. LINT: Nuke SYMTAB_SPACE. Fix comment about DODUMP. Makefile.i386: Nuke use of dbsym. Exclude gcc symbols from kernel unless compiling with -g. Remove unused macro. Fix comments and formatting. genassym.c: Generate defines for some new bootinfo fields. Change names of old ones. locore.s: Copy only the valid part of the `struct bootinfo' passed by the loader. Reserve space for symbol table, if any. machdep.c: Check the memory sizes passed by the loader, if any. Don't use them yet. bootinfo.h: Add a size field so that we can resolve some mismatches between the loader bootinfo and the kernel boot info. The version number is not so good for this because of historical botches and because it's harder to maintain. Add memory size and symbol table fields. Change the names of everything. Hacks to save a few bytes: asm.S, boot.c, boot2.S: Replace `ouraddr' by `(BOOTSEG << 4)'. boot.c: Don't statically initialize `loadflags' to 0. Disable the "REDUNDANT" code that skips the BIOS variables. Eliminate `total'. Combine some more printfs. boot.h, disk.c, io.c, table.c: Move all statically initialzed data to table.c. io.c: Don't put the A20 gate bits in a variable.
Diffstat (limited to 'sys/ddb/db_aout.c')
-rw-r--r--sys/ddb/db_aout.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c
index b704ded..91c67ce 100644
--- a/sys/ddb/db_aout.c
+++ b/sys/ddb/db_aout.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_aout.c,v 1.8 1994/09/05 14:04:56 bde Exp $
+ * $Id: db_aout.c,v 1.9 1994/09/27 03:34:52 phk Exp $
*/
/*
@@ -37,6 +37,9 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
+
+#include <machine/bootinfo.h>
+
#include <ddb/ddb.h>
#include <ddb/db_sym.h>
@@ -67,13 +70,6 @@
(sp = (struct nlist *)((symtab) + 1), \
ep = (struct nlist *)((char *)sp + *(symtab)))
-#ifndef SYMTAB_SPACE
-#define SYMTAB_SPACE 73000
-#endif /*SYMTAB_SPACE*/
-
-int db_symtabsize = SYMTAB_SPACE;
-char db_symtab[SYMTAB_SPACE] = { 1 };
-
void
X_db_sym_init(symtab, esymtab, name)
int * symtab; /* pointer to start of symbol table */
@@ -97,7 +93,6 @@ X_db_sym_init(symtab, esymtab, name)
strtab = (char *)sym_end;
strlen = *(int *)strtab;
-#if 0
if (strtab + ((strlen + sizeof(int) - 1) & ~(sizeof(int)-1))
!= esymtab)
{
@@ -107,7 +102,6 @@ X_db_sym_init(symtab, esymtab, name)
db_printf("[ preserving %#x bytes of %s symbol table ]\n",
esymtab - (char *)symtab, name);
-#endif
for (sp = sym_start; sp < sym_end; sp++) {
register int strx;
@@ -233,9 +227,11 @@ X_db_line_at_pc(symtab, cursym, filename, linenum, off)
sp = (struct nlist *)symtab->start;
ep = (struct nlist *)symtab->end;
-/* XXX - gcc specific */
-#define NEWSRC(str) ((str) != NULL && \
- (str)[0] == 'g' && strcmp((str), "gcc_compiled.") == 0)
+/*
+ * XXX - this used to remove "gcc_compiled.", but that is obsolete. We
+ * now remove unwanted names using symorder.
+ */
+#define NEWSRC(str) 0
for (; sp < ep; sp++) {
@@ -327,16 +323,11 @@ X_db_sym_numargs(symtab, cursym, nargp, argnamep)
void
kdb_init(void)
{
-#if 0
- extern char *esym;
- extern int end;
-
- if (esym > (char *)&end) {
- X_db_sym_init((int *)&end, esym, "kernel");
- }
-#endif
-
- X_db_sym_init (db_symtab, 0, "kernel");
+ if (bootinfo.bi_esymtab != bootinfo.bi_symtab)
+ X_db_sym_init((int *)bootinfo.bi_symtab,
+ (char *)((bootinfo.bi_esymtab + sizeof(int) - 1)
+ & ~(sizeof(int) - 1)),
+ "kernel");
}
#if 0
OpenPOWER on IntegriCloud