diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-01-23 14:57:30 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-01-23 14:57:30 +0000 |
commit | cb3c4160f836effd067e58afe7b091ab6fc69b97 (patch) | |
tree | 0b76574d24b9b37ee6dbfb5d1c3c96074a8ef1e6 /gnu/usr.bin/ld | |
parent | 569d912081b6e4b917696240f6b71e5821e3b205 (diff) |
Fix `internal consistency errors': all warnings for undefined symbols MUST
handle reported_undefineds correctly.
Probably unseen before now because this warning only occurred for symbols
that also triggered other warnings ? or maybe no-one cares.
Diffstat (limited to 'gnu/usr.bin/ld')
-rw-r--r-- | gnu/usr.bin/ld/warnings.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c index 098789cdb13..6dfb5fafd17 100644 --- a/gnu/usr.bin/ld/warnings.c +++ b/gnu/usr.bin/ld/warnings.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: warnings.c,v 1.3 1998/03/26 19:46:29 niklas Exp $*/ +/* * $OpenBSD: warnings.c,v 1.4 2000/01/23 14:57:29 espie Exp $*/ /* */ @@ -679,12 +679,21 @@ do_file_warnings (entry, outfile) } else if (g->def_lsp && g->def_lsp->entry != entry && !(entry->flags & E_DYNAMIC) && g->def_lsp->entry->flags & E_SECONDCLASS) { - fprintf(outfile, - "%s: Undefined symbol `%s' referenced (use %s ?)\n", - get_file_name(entry), - g->name, - g->def_lsp->entry->local_sym_name); - continue; + if (g->undef_refs == 0) + reported_undefineds++; + if (g->undef_refs >= MAX_UREFS_PRINTED) + continue; + if (++(g->undef_refs) == MAX_UREFS_PRINTED) { + errfmt = "More undefined `%s' refs follow"; + line_number = -1; + } else { + fprintf(outfile, + "%s: Undefined symbol `%s' referenced (use %s ?)\n", + get_file_name(entry), + g->name, + g->def_lsp->entry->local_sym_name); + continue; + } } else if (g->warning) { /* * There are two cases in which we don't want to do |