summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/ld/warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/ld/warnings.c')
-rw-r--r--gnu/usr.bin/ld/warnings.c58
1 files changed, 28 insertions, 30 deletions
diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c
index 210be24..d98516a 100644
--- a/gnu/usr.bin/ld/warnings.c
+++ b/gnu/usr.bin/ld/warnings.c
@@ -1,5 +1,5 @@
/*
- * $Id: warnings.c,v 1.4 1993/12/22 23:28:12 jkh Exp $
+ * $Id: warnings.c,v 1.5 1994/01/12 23:14:07 jkh Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,10 @@ print_file_name (entry, outfile)
struct file_entry *entry;
FILE *outfile;
{
+ if (entry == NULL) {
+ fprintf (outfile, "NULL");
+ }
+
if (entry->superfile) {
print_file_name (entry->superfile, outfile);
fprintf (outfile, "(%s)", entry->filename);
@@ -65,7 +69,7 @@ get_file_name (entry)
char *result, *supfile;
if (entry == NULL) {
- return (xmalloc("NULL"));
+ return (char *)strdup("NULL");
}
if (entry->superfile) {
@@ -155,30 +159,24 @@ void
print_symbols(outfile)
FILE *outfile;
{
- register int i;
-
fprintf(outfile, "\nFiles:\n\n");
-
each_file(describe_file_sections, outfile);
fprintf(outfile, "\nGlobal symbols:\n\n");
-
- for (i = 0; i < TABSIZE; i++) {
- register symbol *sp;
- for (sp = symtab[i]; sp; sp = sp->link) {
- if (sp->defined == (N_UNDF|N_EXT))
- fprintf(outfile, " %s: common, length %#x\n",
- sp->name, sp->max_common_size);
- if (!sp->referenced)
- fprintf(outfile, " %s: unreferenced\n",
- sp->name);
- else if (!sp->defined)
- fprintf(outfile, " %s: undefined\n", sp->name);
- else
- fprintf(outfile, " %s: %#x, size %#x\n",
+ FOR_EACH_SYMBOL(i, sp) {
+ if (sp->defined == (N_UNDF|N_EXT))
+ fprintf(outfile, " %s: common, length %#x\n",
+ sp->name, sp->common_size);
+ if (!(sp->flags & GS_REFERENCED))
+ fprintf(outfile, " %s: unreferenced\n", sp->name);
+ else if (sp->so_defined)
+ fprintf(outfile, " %s: sodefined\n", sp->name);
+ else if (!sp->defined)
+ fprintf(outfile, " %s: undefined\n", sp->name);
+ else
+ fprintf(outfile, " %s: %#x, size %#x\n",
sp->name, sp->value, sp->size);
- }
- }
+ } END_EACH_SYMBOL;
each_file(list_file_locals, outfile);
}
@@ -190,7 +188,7 @@ describe_file_sections(entry, outfile)
{
fprintf(outfile, " ");
print_file_name(entry, outfile);
- if (entry->just_syms_flag || entry->is_dynamic)
+ if (entry->flags & (E_JUST_SYMS | E_DYNAMIC))
fprintf(outfile, " symbols only\n", 0);
else
fprintf(outfile, " text %x(%x), data %x(%x), bss %x(%x) hex\n",
@@ -602,7 +600,7 @@ do_file_warnings (entry, outfile)
read_entry_strings (desc, entry);
}
- if (! entry->is_dynamic) {
+ if (!(entry->flags & E_DYNAMIC)) {
/* Do text warnings based on a scan through the relocation info. */
do_relocation_warnings (entry, 0, outfile, nlist_bitvector);
@@ -618,7 +616,7 @@ do_file_warnings (entry, outfile)
for (i = 0; i < number_of_syms; i++) {
struct nlist *s;
- struct glosym *g;
+ symbol *g;
g = entry->symbols[i].symbol;
s = &entry->symbols[i].nzlist.nlist;
@@ -626,14 +624,14 @@ do_file_warnings (entry, outfile)
if (!(s->n_type & N_EXT))
continue;
- if (!g->referenced) {
+ if (!(g->flags & GS_REFERENCED)) {
#if 0
/* Check for undefined shobj symbols */
struct localsymbol *lsp;
register int type;
- for (lsp = g->dynrefs; lsp; lsp = lsp->next) {
- type = lsp->nlist.n_type;
+ for (lsp = g->sorefs; lsp; lsp = lsp->next) {
+ type = lsp->nzlist.nz_type;
if ((type & N_EXT) &&
type != (N_UNDF | N_EXT)) {
break;
@@ -651,7 +649,7 @@ do_file_warnings (entry, outfile)
dont_allow_symbol_name = 0;
- if (list_multiple_defs && g->multiply_defined) {
+ if (list_multiple_defs && g->mult_defs) {
errfmt = "Definition of symbol %s (multiply defined)";
switch (s->n_type) {
@@ -669,13 +667,13 @@ do_file_warnings (entry, outfile)
case N_SETT | N_EXT:
case N_SETD | N_EXT:
case N_SETB | N_EXT:
- if (g->multiply_defined == 2)
+ if (g->mult_defs == 2)
continue;
errfmt = "First set element definition of symbol %s (multiply defined)";
break;
default:
-printf("Multiple def: %s, type %#x\n", g->name, s->n_type);
+printf("multiply defined: %s, type %#x\n", g->name, s->n_type);
/* Don't print out multiple defs at references.*/
continue;
}
OpenPOWER on IntegriCloud