From 8000972bbe1f21d1dac3a4faf00a0565471b7c32 Mon Sep 17 00:00:00 2001 From: dbj Date: Thu, 24 Nov 2005 12:54:29 +0000 Subject: [PATCH] . Have dbsym explicitly suggest increasing SYMTAB_SPACE when an overflow occurs. . Make this error a fatal build time error . Move the support for dbsym into the MI Makefile.kern.inc, conditional upon the SYMTAB_SPACE option being defined in the kernel config file. --- gnu/usr.sbin/dbsym/dbsym.c | 7 ++++--- sys/arch/arc/conf/Makefile.arc.inc | 6 +----- sys/arch/cats/conf/Makefile.cats.inc | 4 +--- sys/arch/dreamcast/conf/Makefile.dreamcast.inc | 6 +----- sys/arch/evbarm/conf/Makefile.evbarm.inc | 6 +----- sys/arch/evbmips/conf/Makefile.evbmips.inc | 4 +--- sys/arch/evbppc/conf/Makefile.ev64260.inc | 8 +------- sys/arch/evbppc/conf/Makefile.explora.inc | 8 +------- sys/arch/evbppc/conf/Makefile.obs200.inc | 8 +------- sys/arch/evbppc/conf/Makefile.obs405.inc | 8 +------- sys/arch/evbppc/conf/Makefile.walnut.inc | 8 +------- sys/arch/macppc/conf/Makefile.macppc | 8 +------- sys/arch/netwinder/conf/Makefile.netwinder.inc | 6 +----- sys/arch/pmppc/conf/INSTALL | 3 +-- sys/arch/pmppc/conf/std.pmppc | 3 +-- sys/arch/powerpc/conf/Makefile.powerpc | 8 +------- sys/arch/sbmips/conf/Makefile.sbmips.inc | 5 ----- sys/arch/shark/conf/Makefile.shark.inc | 4 +--- sys/conf/Makefile.kern.inc | 8 +++++++- 19 files changed, 27 insertions(+), 91 deletions(-) delete mode 100644 sys/arch/sbmips/conf/Makefile.sbmips.inc diff --git a/gnu/usr.sbin/dbsym/dbsym.c b/gnu/usr.sbin/dbsym/dbsym.c index 57c6ffb3d3fb..8d4113775f42 100644 --- a/gnu/usr.sbin/dbsym/dbsym.c +++ b/gnu/usr.sbin/dbsym/dbsym.c @@ -1,4 +1,4 @@ -/* $NetBSD: dbsym.c,v 1.8 2005/06/01 15:12:18 lukem Exp $ */ +/* $NetBSD: dbsym.c,v 1.9 2005/11/24 12:54:29 dbj Exp $ */ /* * Copyright (c) 2001 Simon Burge (for Wasabi Systems) @@ -39,7 +39,7 @@ __COPYRIGHT( "@(#) Copyright (c) 1996 Christopher G. Demetriou, 2001 Simon Burge.\ All rights reserved.\n"); -__RCSID("$NetBSD: dbsym.c,v 1.8 2005/06/01 15:12:18 lukem Exp $"); +__RCSID("$NetBSD: dbsym.c,v 1.9 2005/11/24 12:54:29 dbj Exp $"); #endif /* not lint */ #include @@ -151,7 +151,8 @@ main(int argc, char **argv) &mappedkfile[db_symtab_symbols[X_DB_SYMTABSIZE].offset]); if (symtabsize > symtab_space) - errx(1, "symbol table (%u bytes) too big for buffer (%u bytes)", + errx(1, "symbol table (%u bytes) too big for buffer (%u bytes)\n" + "Increase options SYMTAB_SPACE in your kernel config", symtabsize, symtab_space); if (verbose) diff --git a/sys/arch/arc/conf/Makefile.arc.inc b/sys/arch/arc/conf/Makefile.arc.inc index 3dd626c93b7d..dd110b1f3ca9 100644 --- a/sys/arch/arc/conf/Makefile.arc.inc +++ b/sys/arch/arc/conf/Makefile.arc.inc @@ -1,8 +1,4 @@ -# $NetBSD: Makefile.arc.inc,v 1.13 2005/05/07 14:15:05 tsutsui Exp $ +# $NetBSD: Makefile.arc.inc,v 1.14 2005/11/24 12:54:29 dbj Exp $ CFLAGS+= -mips2 AFLAGS+= -mips2 - -SYSTEM_LD_TAIL_EXTRA=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true diff --git a/sys/arch/cats/conf/Makefile.cats.inc b/sys/arch/cats/conf/Makefile.cats.inc index 8bb9f641ca0d..c4b029eb6ba7 100644 --- a/sys/arch/cats/conf/Makefile.cats.inc +++ b/sys/arch/cats/conf/Makefile.cats.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.cats.inc,v 1.16 2004/09/13 09:39:40 chs Exp $ +# $NetBSD: Makefile.cats.inc,v 1.17 2005/11/24 12:54:29 dbj Exp $ MACHINE_ARCH= arm CPPFLAGS+= -D${MACHINE} @@ -22,8 +22,6 @@ SYSTEM_LD_HEAD_EXTRA+=; \ cat ${ARM}/conf/kern.ldscript.tail ) > ldscript SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true; \ echo \ "${OBJCOPY} -O a.out-arm-netbsd -R .ident -R .arm.atpcs -R .comment $@ $@.aout"; \ ${OBJCOPY} -O a.out-arm-netbsd -R .ident -R .arm.atpcs -R .comment $@ $@.aout diff --git a/sys/arch/dreamcast/conf/Makefile.dreamcast.inc b/sys/arch/dreamcast/conf/Makefile.dreamcast.inc index b89bcc67d20b..cc38bd5af282 100644 --- a/sys/arch/dreamcast/conf/Makefile.dreamcast.inc +++ b/sys/arch/dreamcast/conf/Makefile.dreamcast.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.dreamcast.inc,v 1.8 2002/10/30 12:22:55 tsutsui Exp $ +# $NetBSD: Makefile.dreamcast.inc,v 1.9 2005/11/24 12:54:29 dbj Exp $ MACHINE_ARCH=sh3el @@ -6,7 +6,3 @@ TEXTADDR?=8c010000 .if ${OBJECT_FMT} == "ELF" LINKFORMAT= -N .endif - -SYSTEM_LD_TAIL_EXTRA=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true diff --git a/sys/arch/evbarm/conf/Makefile.evbarm.inc b/sys/arch/evbarm/conf/Makefile.evbarm.inc index 88386b85ca79..ba2d4d2fd802 100644 --- a/sys/arch/evbarm/conf/Makefile.evbarm.inc +++ b/sys/arch/evbarm/conf/Makefile.evbarm.inc @@ -1,8 +1,4 @@ -# $NetBSD: Makefile.evbarm.inc,v 1.16 2003/01/03 02:16:26 thorpej Exp $ - -SYSTEM_LD_TAIL_EXTRA=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true +# $NetBSD: Makefile.evbarm.inc,v 1.17 2005/11/24 12:54:29 dbj Exp $ .if defined(BOARDMKFRAG) # Must be a full pathname. .include "${BOARDMKFRAG}" diff --git a/sys/arch/evbmips/conf/Makefile.evbmips.inc b/sys/arch/evbmips/conf/Makefile.evbmips.inc index 26f449ed6c5d..15d4234d7967 100644 --- a/sys/arch/evbmips/conf/Makefile.evbmips.inc +++ b/sys/arch/evbmips/conf/Makefile.evbmips.inc @@ -1,8 +1,6 @@ -# $NetBSD: Makefile.evbmips.inc,v 1.1 2002/03/07 14:43:57 simonb Exp $ +# $NetBSD: Makefile.evbmips.inc,v 1.2 2005/11/24 12:54:29 dbj Exp $ SYSTEM_LD_TAIL_EXTRA=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true; \ echo ${STRIP} -O srec -o $@.srec $@; \ ${STRIP} -O srec -o $@.srec $@ EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.srec@} diff --git a/sys/arch/evbppc/conf/Makefile.ev64260.inc b/sys/arch/evbppc/conf/Makefile.ev64260.inc index 12a053097ad6..641ddb763d98 100644 --- a/sys/arch/evbppc/conf/Makefile.ev64260.inc +++ b/sys/arch/evbppc/conf/Makefile.ev64260.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.ev64260.inc,v 1.3 2005/03/17 16:45:50 jmc Exp $ +# $NetBSD: Makefile.ev64260.inc,v 1.4 2005/11/24 12:54:29 dbj Exp $ MKIMG?= ${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh @@ -7,12 +7,6 @@ TEXTADDR?= 300000 SYSTEM_FIRST_OBJ= ${BOARDTYPE}_locore.o SYSTEM_FIRST_SFILE= ${THISPPC}/${BOARDTYPE}/${BOARDTYPE}_locore.S -.ifdef DBSYM -SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true -.endif - SYSTEM_LD_TAIL_EXTRA+=; \ echo ${MKIMG} netbsd netbsd.img ; \ OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \ diff --git a/sys/arch/evbppc/conf/Makefile.explora.inc b/sys/arch/evbppc/conf/Makefile.explora.inc index fea6e1c7b7c2..f9bc3b6b7dc8 100644 --- a/sys/arch/evbppc/conf/Makefile.explora.inc +++ b/sys/arch/evbppc/conf/Makefile.explora.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.explora.inc,v 1.3 2005/01/16 23:40:34 chs Exp $ +# $NetBSD: Makefile.explora.inc,v 1.4 2005/11/24 12:54:29 dbj Exp $ CFLAGS+=-mcpu=403 AFLAGS+=-mcpu=403 @@ -6,12 +6,6 @@ AFLAGS+=-mcpu=403 SYSTEM_FIRST_OBJ= explora_start.o SYSTEM_FIRST_SFILE= ${THISPPC}/explora/explora_start.S -.ifdef DBSYM -SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true -.endif - SYSTEM_LD_TAIL_EXTRA+=; \ echo ${OBJCOPY} --adjust-vma 0x81000000 netbsd netbsd.img ; \ ${OBJCOPY} --adjust-vma 0x81000000 netbsd netbsd.img diff --git a/sys/arch/evbppc/conf/Makefile.obs200.inc b/sys/arch/evbppc/conf/Makefile.obs200.inc index bcd785bfc305..b1d650cb5c79 100644 --- a/sys/arch/evbppc/conf/Makefile.obs200.inc +++ b/sys/arch/evbppc/conf/Makefile.obs200.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.obs200.inc,v 1.2 2005/03/29 17:58:15 jmc Exp $ +# $NetBSD: Makefile.obs200.inc,v 1.3 2005/11/24 12:54:29 dbj Exp $ MKIMG?= ${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh @@ -9,12 +9,6 @@ TEXTADDR?= 450000 SYSTEM_FIRST_OBJ= obs200_locore.o SYSTEM_FIRST_SFILE= ${THISPPC}/obs405/obs200_locore.S -.ifdef DBSYM -SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true -.endif - SYSTEM_LD_TAIL_EXTRA+=; \ echo ${MKIMG} netbsd netbsd.img ; \ OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \ diff --git a/sys/arch/evbppc/conf/Makefile.obs405.inc b/sys/arch/evbppc/conf/Makefile.obs405.inc index fd38bb15b31f..06d0f673cfc5 100644 --- a/sys/arch/evbppc/conf/Makefile.obs405.inc +++ b/sys/arch/evbppc/conf/Makefile.obs405.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.obs405.inc,v 1.2 2005/03/17 16:45:50 jmc Exp $ +# $NetBSD: Makefile.obs405.inc,v 1.3 2005/11/24 12:54:29 dbj Exp $ MKIMG?= ${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh @@ -9,12 +9,6 @@ TEXTADDR?= 25000 SYSTEM_FIRST_OBJ= locore.o SYSTEM_FIRST_SFILE= ${POWERPC}/${PPCDIR}/openbios/locore.S -.ifdef DBSYM -SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true -.endif - SYSTEM_LD_TAIL_EXTRA+=; \ echo ${MKIMG} netbsd netbsd.img ; \ OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \ diff --git a/sys/arch/evbppc/conf/Makefile.walnut.inc b/sys/arch/evbppc/conf/Makefile.walnut.inc index b12b3370cae6..fd0a1335d58f 100644 --- a/sys/arch/evbppc/conf/Makefile.walnut.inc +++ b/sys/arch/evbppc/conf/Makefile.walnut.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.walnut.inc,v 1.3 2005/03/17 16:45:50 jmc Exp $ +# $NetBSD: Makefile.walnut.inc,v 1.4 2005/11/24 12:54:29 dbj Exp $ MKIMG?= ${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh CFLAGS+=-mcpu=403 @@ -8,12 +8,6 @@ TEXTADDR?= 25000 SYSTEM_FIRST_OBJ= walnut_start.o SYSTEM_FIRST_SFILE= ${THISPPC}/walnut/walnut_start.S -.ifdef DBSYM -SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true -.endif - SYSTEM_LD_TAIL_EXTRA+=; \ echo ${MKIMG} netbsd netbsd.img ; \ OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \ diff --git a/sys/arch/macppc/conf/Makefile.macppc b/sys/arch/macppc/conf/Makefile.macppc index 61a6072ee1a6..8af5cd73bb19 100644 --- a/sys/arch/macppc/conf/Makefile.macppc +++ b/sys/arch/macppc/conf/Makefile.macppc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.macppc,v 1.23 2005/10/19 09:01:27 dyoung Exp $ +# $NetBSD: Makefile.macppc,v 1.24 2005/11/24 12:54:29 dbj Exp $ # # Makefile for NetBSD # @@ -75,12 +75,6 @@ TEXTADDR?= 0x100000 LINKFORMAT= -N ENTRYPOINT= __start -.if defined(NEED_SYMTAB) -SYSTEM_LD_TAIL_EXTRA=; \ - echo ${DBSYM} $@; \ - ${DBSYM} $@ -.endif - .if defined(NEED_SREC) SYSTEM_LD_TAIL_EXTRA+=; \ ${OBJCOPY} -v -O srec $@ $@.srec diff --git a/sys/arch/netwinder/conf/Makefile.netwinder.inc b/sys/arch/netwinder/conf/Makefile.netwinder.inc index a8c8301e46c9..c42791648665 100644 --- a/sys/arch/netwinder/conf/Makefile.netwinder.inc +++ b/sys/arch/netwinder/conf/Makefile.netwinder.inc @@ -1,11 +1,7 @@ -# $NetBSD: Makefile.netwinder.inc,v 1.7 2003/01/03 02:34:49 thorpej Exp $ +# $NetBSD: Makefile.netwinder.inc,v 1.8 2005/11/24 12:54:29 dbj Exp $ CPPFLAGS+= -D${MACHINE} -SYSTEM_LD_TAIL_EXTRA=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true - SYSTEM_FIRST_OBJ= nwmmu.o SYSTEM_FIRST_SFILE= ${THISARM}/${MACHINE}/nwmmu.S diff --git a/sys/arch/pmppc/conf/INSTALL b/sys/arch/pmppc/conf/INSTALL index 1406f7310472..8da59b7ef191 100644 --- a/sys/arch/pmppc/conf/INSTALL +++ b/sys/arch/pmppc/conf/INSTALL @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.19 2005/08/19 05:19:54 christos Exp $ +# $NetBSD: INSTALL,v 1.20 2005/11/24 12:54:30 dbj Exp $ # # INSTALL # @@ -44,7 +44,6 @@ options MALLOC_NOINLINE # Not inlining MALLOC saves memory #options DDB_HISTORY_SIZE=512 # enable history editing in DDB #options TRAP_PANICWAIT #options SYMTAB_SPACE=200000 # size for embedded symbol table -no makeoptions NEED_SYMTAB #makeoptions DEBUG="-g" # compile full symbol table diff --git a/sys/arch/pmppc/conf/std.pmppc b/sys/arch/pmppc/conf/std.pmppc index e1eb864cf440..d3ad687a151d 100644 --- a/sys/arch/pmppc/conf/std.pmppc +++ b/sys/arch/pmppc/conf/std.pmppc @@ -1,4 +1,4 @@ -# $NetBSD: std.pmppc,v 1.6 2005/09/17 09:44:08 yamt Exp $ +# $NetBSD: std.pmppc,v 1.7 2005/11/24 12:54:30 dbj Exp $ # # standard, required NetBSD/pmppc 'options' @@ -16,5 +16,4 @@ options INTSTK=0x2000 makeoptions TEXTADDR=0x40000 -makeoptions NEED_SYMTAB=1 makeoptions NEED_BINARY=1 diff --git a/sys/arch/powerpc/conf/Makefile.powerpc b/sys/arch/powerpc/conf/Makefile.powerpc index 5b4f3700b90a..a1010c5c45db 100644 --- a/sys/arch/powerpc/conf/Makefile.powerpc +++ b/sys/arch/powerpc/conf/Makefile.powerpc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.powerpc,v 1.35 2005/06/02 14:35:08 he Exp $ +# $NetBSD: Makefile.powerpc,v 1.36 2005/11/24 12:54:30 dbj Exp $ # # Makefile for NetBSD # @@ -75,12 +75,6 @@ TEXTADDR?= 0x100000 LINKFORMAT= -N ENTRYPOINT= __start -.if defined(NEED_SYMTAB) -SYSTEM_LD_TAIL_EXTRA=; \ - echo ${DBSYM} $@; \ - ${DBSYM} $@ -.endif - .if defined(NEED_SREC) SYSTEM_LD_TAIL_EXTRA+=; \ ${OBJCOPY} -v -O srec $@ $@.srec diff --git a/sys/arch/sbmips/conf/Makefile.sbmips.inc b/sys/arch/sbmips/conf/Makefile.sbmips.inc deleted file mode 100644 index 8a70d2c65d12..000000000000 --- a/sys/arch/sbmips/conf/Makefile.sbmips.inc +++ /dev/null @@ -1,5 +0,0 @@ -# $NetBSD: Makefile.sbmips.inc,v 1.1 2002/03/06 02:13:38 simonb Exp $ - -SYSTEM_LD_TAIL_EXTRA=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true; diff --git a/sys/arch/shark/conf/Makefile.shark.inc b/sys/arch/shark/conf/Makefile.shark.inc index d040fae2471b..bb9a8a55d8c5 100644 --- a/sys/arch/shark/conf/Makefile.shark.inc +++ b/sys/arch/shark/conf/Makefile.shark.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.shark.inc,v 1.5 2004/09/13 09:39:40 chs Exp $ +# $NetBSD: Makefile.shark.inc,v 1.6 2005/11/24 12:54:30 dbj Exp $ MACHINE_ARCH= arm CPPFLAGS+= -D${MACHINE} @@ -17,8 +17,6 @@ SYSTEM_LD_HEAD_EXTRA+=; \ cat ${ARM}/conf/kern.ldscript.tail ) > ldscript SYSTEM_LD_TAIL_EXTRA+=; \ - echo "${DBSYM} $@ || true"; \ - ${DBSYM} $@ || true; \ echo \ "${OBJCOPY} -O a.out-arm-netbsd -R .ident -R .arm.atpcs -R .comment $@ $@.aout"; \ ${OBJCOPY} -O a.out-arm-netbsd -R .ident -R .arm.atpcs -R .comment $@ $@.aout diff --git a/sys/conf/Makefile.kern.inc b/sys/conf/Makefile.kern.inc index 8bbf101c7c1a..97d494737304 100644 --- a/sys/conf/Makefile.kern.inc +++ b/sys/conf/Makefile.kern.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.69 2005/11/02 14:29:52 yamt Exp $ +# $NetBSD: Makefile.kern.inc,v 1.70 2005/11/24 12:54:29 dbj Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -208,6 +208,12 @@ EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@} LINKFLAGS+= ${LINKFLAGS_NORMAL} .endif +SYSTEM_LD_TAIL+=; \ + if grep -q '^\#define.*SYMTAB_SPACE' opt_ddbparam.h; then \ + echo "${DBSYM} $@"; \ + ${DBSYM} $@; \ + fi + SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA} SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_EXTRA}