diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-02-12 21:17:54 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-02-12 21:17:54 +0000 |
commit | 447ae244135ecd8dc37c03d39c113080fb7dcaed (patch) | |
tree | 512491baf623376e1bd59985ee97931f6d3dfee5 /gnu/usr.bin/ld | |
parent | 846cc249b75ff1ea72b01601c5ae38dab7f2fc8b (diff) |
Fix a few warnings, including an uninitialized variable in an error case.
Diffstat (limited to 'gnu/usr.bin/ld')
-rw-r--r-- | gnu/usr.bin/ld/ld.c | 4 | ||||
-rw-r--r-- | gnu/usr.bin/ld/lib.c | 9 | ||||
-rw-r--r-- | gnu/usr.bin/ld/rrs.c | 7 | ||||
-rw-r--r-- | gnu/usr.bin/ld/warnings.c | 3 |
4 files changed, 13 insertions, 10 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index eacb615ff47..4c5923336ac 100644 --- a/gnu/usr.bin/ld/ld.c +++ b/gnu/usr.bin/ld/ld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ld.c,v 1.32 2005/09/30 20:27:52 deraadt Exp $ */ +/* $OpenBSD: ld.c,v 1.33 2008/02/12 21:17:53 miod Exp $ */ /* $NetBSD: ld.c,v 1.52 1998/02/20 03:12:51 jonathan Exp $ */ /*- @@ -2033,7 +2033,7 @@ printf("pass1: SO definition for %s, type %x in %s at %#x\n", } END_EACH_SYMBOL; if (setv_fill_count != set_sect_size/sizeof(long)) - errx(1, "internal error: allocated set symbol space (%d) " + errx(1, "internal error: allocated set symbol space (%ld) " "doesn't match actual (%d)", set_sect_size/sizeof(long), setv_fill_count); } diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c index cbd41719949..9b2563c31ab 100644 --- a/gnu/usr.bin/ld/lib.c +++ b/gnu/usr.bin/ld/lib.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: lib.c,v 1.12 2003/05/07 21:52:13 vincent Exp $ - library routines*/ +/* * $OpenBSD: lib.c,v 1.13 2008/02/12 21:17:53 miod Exp $ - library routines*/ /* */ @@ -634,10 +634,11 @@ read_shared_object(int fd, struct file_entry *entry) errx(1, "%s: premature EOF reading symbols ", get_file_name(entry)); - if (has_nz) + if (has_nz) { md_swapin_zsymbols(nzp, entry->nsymbols); - else + } else { md_swapin_symbols(np, entry->nsymbols); + } /* Convert to structs localsymbol */ for (i = 0; i < entry->nsymbols; i++) { @@ -824,7 +825,7 @@ findlib(struct file_entry *p) dot_a: p->flags &= ~E_SEARCH_DYNAMIC; - if (cp = strrchr(p->filename, '/')) { + if ((cp = strrchr(p->filename, '/'))) { char *tmp; *cp++ = '\0'; tmp = concat(p->filename, "/lib", cp); diff --git a/gnu/usr.bin/ld/rrs.c b/gnu/usr.bin/ld/rrs.c index 9af8f3c2619..5fef6291e1a 100644 --- a/gnu/usr.bin/ld/rrs.c +++ b/gnu/usr.bin/ld/rrs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrs.c,v 1.11 2005/09/29 20:40:35 deraadt Exp $*/ +/* $OpenBSD: rrs.c,v 1.12 2008/02/12 21:17:53 miod Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -1184,10 +1184,11 @@ write_rrs_text(void) offset, rrs_strtab_size); /* Write the symbol table */ - if (rrs_symbol_size == sizeof(struct nlist)) + if (rrs_symbol_size == sizeof(struct nlist)) { md_swapout_symbols(rrs_symbols, number_of_rrs_symbols); - else + } else { md_swapout_zsymbols(rrs_symbols, number_of_rrs_symbols); + } mywrite(rrs_symbols, symsize, 1, outstream); /* Write the strings */ diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c index 448a517d6ee..c68806b80fa 100644 --- a/gnu/usr.bin/ld/warnings.c +++ b/gnu/usr.bin/ld/warnings.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: warnings.c,v 1.11 2005/12/21 01:40:22 millert Exp $*/ +/* * $OpenBSD: warnings.c,v 1.12 2008/02/12 21:17:53 miod Exp $*/ /* */ @@ -644,6 +644,7 @@ do_file_warnings(struct file_entry *entry, void *arg) "of symbol `%s', type %#x", get_file_name(entry), g->name, np->n_type); + line_number = -1; break; } |