diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-07-19 19:28:13 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-07-19 19:28:13 +0000 |
commit | 4949dbe071951e4093685c0e84a63dc5451eca45 (patch) | |
tree | 531eb3504f538dd7365ed53dd7799f381ed067ea /gnu/usr.bin/ld | |
parent | 2cb47dcca29852637cb080135bb980889a2e08f4 (diff) |
convert functions from K&R style to prototype style.
Function arg types have not yet been fixed. OK fgs@, espie@
Diffstat (limited to 'gnu/usr.bin/ld')
26 files changed, 367 insertions, 860 deletions
diff --git a/gnu/usr.bin/ld/arm32/md.c b/gnu/usr.bin/ld/arm32/md.c index 88d7cc6882f..3ef0f78ffaf 100644 --- a/gnu/usr.bin/ld/arm32/md.c +++ b/gnu/usr.bin/ld/arm32/md.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md.c,v 1.1 1996/06/17 00:10:44 deraadt Exp $ */ +/* $OpenBSD: md.c,v 1.2 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD$ */ /* @@ -50,9 +50,7 @@ * from address ADDR */ long -md_get_addend(rp, addr) -struct relocation_info *rp; -unsigned char *addr; +md_get_addend(struct relocation_info *rp, unsigned char *addr) { long rel; @@ -83,11 +81,8 @@ unsigned char *addr; static struct relocation_info *rrs_reloc; /* HACK HACK HACK XXX */ void -md_relocate(rp, relocation, addr, relocatable_output) -struct relocation_info *rp; -long relocation; -unsigned char *addr; -int relocatable_output; +md_relocate(struct relocation_info *rp, long relocation, unsigned char *addr, + int relocatable_output) { if (rp == rrs_reloc /* HACK HACK HACK XXX */ || (RELOC_PCREL_P(rp) && relocatable_output)) { @@ -126,9 +121,7 @@ int relocatable_output; * Set RRS relocation type. */ int -md_make_reloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_reloc(struct relocation_info *rp, struct relocation_info *r, int type) { if (type == RELTYPE_EXTERN) rrs_reloc = rp; /* HACK HACK HACK XXX */ @@ -150,10 +143,7 @@ int type; * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) -jmpslot_t *sp; -long offset; -long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { u_long fudge = - (offset + 12); @@ -168,10 +158,7 @@ long index; * and by `ld.so' after resolving the symbol. */ void -md_fix_jmpslot(sp, offset, addr) -jmpslot_t *sp; -long offset; -u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { /* * Generate the following sequence: @@ -186,9 +173,8 @@ u_long addr; * Update the relocation record for a RRS jmpslot. */ void -md_make_jmpreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_jmpreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { r->r_address += 8; r->r_pcrel = 0; @@ -203,9 +189,8 @@ int type; * Set relocation type for a RRS GOT relocation. */ void -md_make_gotreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_gotreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { r->r_pcrel = 0; r->r_length = 2; @@ -219,8 +204,7 @@ int type; * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) -struct relocation_info *rp, *r; +md_make_cpyreloc(struct relocation_info *rp, struct relocation_info *r) { r->r_pcrel = 0; r->r_length = 2; @@ -231,9 +215,7 @@ struct relocation_info *rp, *r; } void -md_set_breakpoint(where, savep) -long where; -long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(long *)where = TRAP; @@ -246,9 +228,7 @@ long *savep; * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) -struct exec *hp; -int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { N_SETMAGIC((*hp), magic, MID_ARM6, flags); @@ -265,8 +245,7 @@ int magic, flags; */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { /* NetBSD: Always leave magic alone */ int skip = 1; @@ -275,8 +254,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD: Always leave magic alone */ int skip = 1; @@ -286,9 +264,7 @@ struct exec *h; void -md_swapin_reloc(r, n) -struct relocation_info *r; -int n; +md_swapin_reloc(struct relocation_info *r, int n) { int bits; @@ -307,9 +283,7 @@ int n; } void -md_swapout_reloc(r, n) -struct relocation_info *r; -int n; +md_swapout_reloc(struct relocation_info *r, int n) { int bits; @@ -328,9 +302,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode1 = md_swap_long(j->opcode1); diff --git a/gnu/usr.bin/ld/cplus-dem.c b/gnu/usr.bin/ld/cplus-dem.c index 32fb5376aac..02c41d81206 100644 --- a/gnu/usr.bin/ld/cplus-dem.c +++ b/gnu/usr.bin/ld/cplus-dem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cplus-dem.c,v 1.2 1998/03/26 19:46:15 niklas Exp $ */ +/* $OpenBSD: cplus-dem.c,v 1.3 2002/07/19 19:28:11 marc Exp $ */ /*- * This code is derived from software copyrighted by the Free Software @@ -7,7 +7,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)cplus-dem.c 5.4 (Berkeley) 4/30/91";*/ -static char rcsid[] = "$OpenBSD: cplus-dem.c,v 1.2 1998/03/26 19:46:15 niklas Exp $"; +static char rcsid[] = "$OpenBSD: cplus-dem.c,v 1.3 2002/07/19 19:28:11 marc Exp $"; #endif /* not lint */ /* Demangler for GNU C++ @@ -184,8 +184,7 @@ static void remember_type (); #endif char * -cplus_demangle (type) - const char *type; +cplus_demangle(const char *type) { string decl; int n; @@ -347,9 +346,7 @@ cplus_demangle (type) } static int -get_count (type, count) - const char **type; - int *count; +get_count(const char **type, int *count) { if (!isdigit (**type)) return 0; @@ -379,9 +376,7 @@ get_count (type, count) /* result will be initialised here; it will be freed on failure */ static int -do_type (type, result) - const char **type; - string *result; +do_type(const char **type, string *result) { int n; int done; @@ -683,9 +678,7 @@ do_type (type, result) /* `result' will be initialised in do_type; it will be freed on failure */ static int -do_arg (type, result) - const char **type; - string *result; +do_arg(const char **type, string *result) { const char *start = *type; @@ -696,9 +689,7 @@ do_arg (type, result) } static void -remember_type (start, len) - const char *start; - int len; +remember_type(const char *start, int len) { char *tem; @@ -725,9 +716,7 @@ remember_type (start, len) it won't be freed on failure */ static int -do_args (type, decl) - const char **type; - string *decl; +do_args(const char **type, string *decl) { string arg; int need_comma = 0; @@ -782,8 +771,7 @@ do_args (type, decl) } static void -munge_function_name (name) - string *name; +munge_function_name(string *name) { if (!string_empty (name) && name->p - name->b >= 3 && name->b[0] == 'o' && name->b[1] == 'p' && name->b[2] == '$') @@ -844,9 +832,7 @@ munge_function_name (name) /* a mini string-handling package */ static void -string_need (s, n) - string *s; - int n; +string_need(string *s, int n) { if (s->b == NULL) { @@ -867,8 +853,7 @@ string_need (s, n) } static void -string_delete (s) - string *s; +string_delete(string *s) { if (s->b != NULL) { @@ -878,30 +863,25 @@ string_delete (s) } static void -string_init (s) - string *s; +string_init(string *s) { s->b = s->p = s->e = NULL; } static void -string_clear (s) - string *s; +string_clear(string *s) { s->p = s->b; } static int -string_empty (s) - string *s; +string_empty(string *s) { return s->b == s->p; } static void -string_append (p, s) - string *p; - const char *s; +string_append(string *p, const char *s) { int n; if (s == NULL || *s == '\0') @@ -913,8 +893,7 @@ string_append (p, s) } static void -string_appends (p, s) - string *p, *s; +string_appends(string *p, string *s) { int n; if (s->b == s->p) @@ -926,10 +905,7 @@ string_appends (p, s) } static void -string_appendn (p, s, n) - string *p; - const char *s; - int n; +string_appendn(string *p, const char *s, int n) { if (n == 0) return; @@ -939,9 +915,7 @@ string_appendn (p, s, n) } static void -string_prepend (p, s) - string *p; - const char *s; +string_prepend(string *p, const char *s) { if (s == NULL || *s == '\0') return; @@ -950,8 +924,7 @@ string_prepend (p, s) #if 0 static void -string_prepends (p, s) - string *p, *s; +string_prepends(string *p, string *s) { if (s->b == s->p) return; @@ -960,10 +933,7 @@ string_prepends (p, s) #endif static void -string_prependn (p, s, n) - string *p; - const char *s; - int n; +string_prependn(string *p, const char *s, int n) { char *q; diff --git a/gnu/usr.bin/ld/i386/md-static-funcs.c b/gnu/usr.bin/ld/i386/md-static-funcs.c index 28041323785..74f1fd73a83 100644 --- a/gnu/usr.bin/ld/i386/md-static-funcs.c +++ b/gnu/usr.bin/ld/i386/md-static-funcs.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md-static-funcs.c,v 1.3 2002/07/15 21:05:57 marc Exp $*/ +/* * $OpenBSD: md-static-funcs.c,v 1.4 2002/07/19 19:28:12 marc Exp $*/ /* * * Called by ld.so when onanating. @@ -6,10 +6,7 @@ */ static void -md_relocate_simple(r, relocation, addr) -struct relocation_info *r; -long relocation; -char *addr; +md_relocate_simple(struct relocation_info *r, long relocation, char *addr) { if (r->r_relative) *(long *)addr += relocation; diff --git a/gnu/usr.bin/ld/i386/md.c b/gnu/usr.bin/ld/i386/md.c index fe48c842b9a..007bbbaa868 100644 --- a/gnu/usr.bin/ld/i386/md.c +++ b/gnu/usr.bin/ld/i386/md.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md.c,v 1.4 2002/07/15 21:05:57 marc Exp $*/ +/* * $OpenBSD: md.c,v 1.5 2002/07/19 19:28:12 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -47,9 +47,7 @@ * from address ADDR */ long -md_get_addend(rp, addr) -struct relocation_info *rp; -unsigned char *addr; +md_get_addend(struct relocation_info *rp, unsigned char *addr) { switch (RELOC_TARGET_SIZE(rp)) { case 0: @@ -68,11 +66,8 @@ unsigned char *addr; * Put RELOCATION at ADDR according to relocation record RP. */ void -md_relocate(rp, relocation, addr, relocatable_output) -struct relocation_info *rp; -long relocation; -unsigned char *addr; -int relocatable_output; +md_relocate(struct relocation_info *rp, long relocation, unsigned char *addr, + int relocatable_output) { switch (RELOC_TARGET_SIZE(rp)) { case 0: @@ -95,9 +90,7 @@ int relocatable_output; * Set RRS relocation type. */ int -md_make_reloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_reloc(struct relocation_info *rp, struct relocation_info *r, int type) { /* Relocation size */ r->r_length = rp->r_length; @@ -119,10 +112,7 @@ int type; * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) -jmpslot_t *sp; -long offset; -long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { /* * i386 PC-relative "fixed point" is located right after the @@ -148,10 +138,7 @@ long index; * further RRS relocations will be necessary for such a jmpslot. */ void -md_fix_jmpslot(sp, offset, addr) -jmpslot_t *sp; -long offset; -u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { u_long fudge = addr - (sizeof(sp->opcode) + sizeof(sp->addr) + offset); @@ -169,9 +156,8 @@ u_long addr; * Update the relocation record for a RRS jmpslot. */ void -md_make_jmpreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_jmpreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { jmpslot_t *sp; @@ -195,9 +181,8 @@ int type; * Set relocation type for a RRS GOT relocation. */ void -md_make_gotreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_gotreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { r->r_baserel = 1; if (type & RELTYPE_RELATIVE) @@ -211,8 +196,7 @@ int type; * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) -struct relocation_info *rp, *r; +md_make_cpyreloc(struct relocation_info *rp, struct relocation_info *r) { /* Relocation size */ r->r_length = 2; @@ -221,9 +205,7 @@ struct relocation_info *rp, *r; } void -md_set_breakpoint(where, savep) -long where; -long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(char *)where = TRAP; @@ -240,9 +222,7 @@ int netzmagic; * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) -struct exec *hp; -int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { #if defined(__NetBSD__) || defined(__OpenBSD__) if (oldmagic || magic == QMAGIC) @@ -272,8 +252,7 @@ int magic, flags; */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { int skip = 0; @@ -284,8 +263,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD/OpenBSD: Always leave magic alone */ int skip = 1; @@ -299,9 +277,7 @@ struct exec *h; void -md_swapin_reloc(r, n) -struct relocation_info *r; -int n; +md_swapin_reloc(struct relocation_info *r, int n) { int bits; @@ -322,9 +298,7 @@ int n; } void -md_swapout_reloc(r, n) -struct relocation_info *r; -int n; +md_swapout_reloc(struct relocation_info *r, int n) { int bits; @@ -345,9 +319,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode = md_swap_short(j->opcode); diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index 50736ab7a0a..367b40f1de9 100644 --- a/gnu/usr.bin/ld/ld.c +++ b/gnu/usr.bin/ld/ld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ld.c,v 1.26 2002/07/17 20:33:29 marc Exp $ */ +/* $OpenBSD: ld.c,v 1.27 2002/07/19 19:28:11 marc Exp $ */ /* $NetBSD: ld.c,v 1.52 1998/02/20 03:12:51 jonathan Exp $ */ /*- @@ -280,9 +280,7 @@ static int parse(char *, char *, char *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { if (atexit(cleanup)) @@ -431,8 +429,7 @@ main(argc, argv) */ static int -classify_arg(arg) - char *arg; +classify_arg(char *arg) { if (*arg != '-') return 0; @@ -494,9 +491,7 @@ classify_arg(arg) */ static void -decode_command(argc, argv) - int argc; - char **argv; +decode_command(int argc, char **argv) { int i; struct file_entry *p; @@ -602,8 +597,7 @@ decode_command(argc, argv) } void -add_cmdline_ref(sp) - symbol *sp; +add_cmdline_ref(symbol *sp) { symbol **ptr; @@ -625,8 +619,7 @@ add_cmdline_ref(sp) } int -set_element_prefixed_p(name) - char *name; +set_element_prefixed_p(char *name) { struct string_list_element *p; int i; @@ -649,8 +642,7 @@ set_element_prefixed_p(name) */ static void -decode_option(swt, arg) - char *swt, *arg; +decode_option(char *swt, char *arg) { if (!strcmp(swt + 1, "Bstatic")) return; @@ -877,9 +869,7 @@ do_rpath: */ void -each_file(function, arg) - void (*function)(); - void *arg; +each_file(void (*function)(), void *arg) { int i; @@ -930,9 +920,7 @@ each_file(function, arg) */ unsigned long -check_each_file(function, arg) - unsigned long (*function)(); - void *arg; +check_each_file(unsigned long (*function)(), void *arg) { int i; unsigned long return_val; @@ -958,9 +946,7 @@ check_each_file(function, arg) /* Like `each_file' but ignore files that were just for symbol definitions. */ void -each_full_file(function, arg) - void (*function)(); - void *arg; +each_full_file(void (*function)(), void *arg) { int i; @@ -1007,7 +993,7 @@ each_full_file(function, arg) /* Close the input file that is now open. */ void -file_close() +file_close(void) { close(input_desc); input_desc = 0; @@ -1020,8 +1006,7 @@ file_close() * open is not actually done. */ int -file_open(entry) - struct file_entry *entry; +file_open(struct file_entry *entry) { int fd; @@ -1053,8 +1038,7 @@ file_open(entry) } int -text_offset(entry) - struct file_entry *entry; +text_offset(struct file_entry *entry) { return entry->starting_offset + N_TXTOFF (entry->header); } @@ -1066,9 +1050,7 @@ text_offset(entry) * descriptor on which the file is open. ENTRY is the file's entry. */ void -read_header(fd, entry) - int fd; - struct file_entry *entry; +read_header(int fd, struct file_entry *entry) { int len; @@ -1098,9 +1080,7 @@ read_header(fd, entry) */ void -read_entry_symbols(fd, entry) - struct file_entry *entry; - int fd; +read_entry_symbols(int fd, struct file_entry *entry) { int str_size; struct nlist *np; @@ -1153,9 +1133,7 @@ read_entry_symbols(fd, entry) * Read the string table of file ENTRY open on descriptor FD, into core. */ void -read_entry_strings(fd, entry) - struct file_entry *entry; - int fd; +read_entry_strings(int fd, struct file_entry *entry) { if (entry->string_size == 0) @@ -1181,9 +1159,7 @@ read_entry_strings(fd, entry) /* Read in the relocation sections of ENTRY if necessary */ void -read_entry_relocation(fd, entry) - int fd; - struct file_entry *entry; +read_entry_relocation(int fd, struct file_entry *entry) { struct relocation_info *reloc; off_t pos; @@ -1260,7 +1236,7 @@ will_see_later(const char *name) * Read in the symbols of all input files. */ static void -load_symbols() +load_symbols(void) { if (trace_files) @@ -1280,8 +1256,7 @@ load_symbols() */ void -read_file_symbols(entry) - struct file_entry *entry; +read_file_symbols(struct file_entry *entry) { int fd; int len; @@ -1346,8 +1321,7 @@ read_file_symbols(entry) */ void -enter_file_symbols(entry) - struct file_entry *entry; +enter_file_symbols(struct file_entry *entry) { struct localsymbol *lsp, *lspend; @@ -1431,10 +1405,7 @@ enter_file_symbols(entry) */ static void -enter_global_ref(lsp, name, entry) - struct localsymbol *lsp; - char *name; - struct file_entry *entry; +enter_global_ref(struct localsymbol *lsp, char *name, struct file_entry *entry) { struct nzlist *nzp = &lsp->nzlist; symbol *sp = getsym(name); @@ -1697,9 +1668,7 @@ enter_global_ref(lsp, name, entry) */ unsigned long -contains_symbol(entry, np) - struct file_entry *entry; - struct nlist *np; +contains_symbol(struct file_entry *entry, struct nlist *np) { if (np >= &entry->symbols->nzlist.nlist && np < &(entry->symbols + entry->nsymbols)->nzlist.nlist) @@ -1740,7 +1709,7 @@ contains_symbol(entry, np) */ static void -digest_symbols() +digest_symbols(void) { if (trace_files) @@ -1891,7 +1860,7 @@ printf( * Determine the definition of each global symbol. */ static void -digest_pass1() +digest_pass1(void) { /* @@ -2119,9 +2088,7 @@ printf("pass1: SO definition for %s, type %x in %s at %#x\n", * of the output file. */ static void -consider_relocation(entry, dataseg) - struct file_entry *entry; - int dataseg; +consider_relocation( struct file_entry *entry, int dataseg) { struct relocation_info *reloc, *end; struct localsymbol *lsp; @@ -2307,8 +2274,7 @@ consider_relocation(entry, dataseg) * Determine the disposition of each local symbol. */ static void -consider_local_symbols(entry) - struct file_entry *entry; +consider_local_symbols(struct file_entry *entry) { struct localsymbol *lsp, *lspend; @@ -2378,8 +2344,7 @@ consider_local_symbols(entry) * the output file. */ static void -consider_file_section_lengths(entry) - struct file_entry *entry; +consider_file_section_lengths(struct file_entry *entry) { entry->text_start_address = text_size; @@ -2400,8 +2365,7 @@ consider_file_section_lengths(entry) * Also relocate the addresses of the file's local and debugger symbols. */ static void -relocate_file_addresses(entry) - struct file_entry *entry; +relocate_file_addresses(struct file_entry *entry) { struct localsymbol *lsp, *lspend; @@ -2463,7 +2427,7 @@ printf("%s: datastart: %#x, bss %#x\n", get_file_name(entry), * Assign a value to each global symbol. */ static void -digest_pass2() +digest_pass2(void) { FOR_EACH_SYMBOL(i, sp) { int size; @@ -2638,7 +2602,7 @@ digest_pass2() /* Write the output file */ void -write_output() +write_output(void) { struct stat statbuf; int filemode; @@ -2696,7 +2660,7 @@ write_output() static int nsyms; void -write_header() +write_header(void) { int flags; @@ -2764,7 +2728,7 @@ write_header() * and write to the output file. */ void -write_text() +write_text(void) { if (trace_files) @@ -2785,8 +2749,7 @@ write_text() * reuse. */ void -copy_text(entry) - struct file_entry *entry; +copy_text(struct file_entry *entry) { char *bytes; int fd; @@ -2823,7 +2786,7 @@ copy_text(entry) */ void -write_data() +write_data(void) { off_t pos; @@ -2860,8 +2823,7 @@ write_data() * reuse. See comments in `copy_text'. */ void -copy_data(entry) - struct file_entry *entry; +copy_data(struct file_entry *entry) { char *bytes; int fd; @@ -2899,13 +2861,8 @@ copy_data(entry) int pc_relocation; void -perform_relocation(data, data_size, reloc, nreloc, entry, dataseg) - char *data; - int data_size; - struct relocation_info *reloc; - int nreloc; - struct file_entry *entry; - int dataseg; +perform_relocation(char *data, int data_size, struct relocation_info *reloc, + int nreloc, struct file_entry *entry, int dataseg) { struct relocation_info *r = reloc; @@ -3153,7 +3110,7 @@ perform_relocation(data, data_size, reloc, nreloc, entry, dataseg) * relocating the addresses-to-be-relocated. */ void -write_rel() +write_rel(void) { int count = 0; @@ -3207,9 +3164,7 @@ write_rel() * Assign symbol ordinal numbers to local symbols in each entry. */ static void -assign_symbolnums(entry, countp) - struct file_entry *entry; - int *countp; +assign_symbolnums(struct file_entry *entry, int *countp) { struct localsymbol *lsp, *lspend; int n = *countp; @@ -3228,8 +3183,7 @@ assign_symbolnums(entry, countp) } static void -coptxtrel(entry) - struct file_entry *entry; +coptxtrel(struct file_entry *entry) { struct relocation_info *r, *end; int reloc = entry->text_start_address; @@ -3293,8 +3247,7 @@ coptxtrel(entry) } static void -copdatrel(entry) - struct file_entry *entry; +copdatrel(struct file_entry *entry) { struct relocation_info *r, *end; /* @@ -3392,8 +3345,7 @@ static int strtab_index; */ static int -assign_string_table_index(name) - char *name; +assign_string_table_index(char *name) { int index = strtab_size; int len = strlen(name) + 1; @@ -3411,7 +3363,7 @@ assign_string_table_index(name) * symbols. */ void -write_string_table() +write_string_table(void) { int i; @@ -3427,7 +3379,7 @@ write_string_table() /* Write the symbol table and string table of the output file. */ void -write_syms() +write_syms(void) { /* Number of symbols written so far. */ int syms_written = 0; @@ -3698,9 +3650,7 @@ printf("writesym(#%d): %s, type %x\n", syms_written, sp->name, sp->defined); * would be confused if we did that. */ void -write_file_syms(entry, syms_written_addr) - struct file_entry *entry; - int *syms_written_addr; +write_file_syms(struct file_entry *entry, int *syms_written_addr) { struct localsymbol *lsp, *lspend; @@ -3806,8 +3756,7 @@ write_file_syms(entry, syms_written_addr) */ static int -parse(arg, format, error) - char *arg, *format, *error; +parse(char *arg, char *format, char *error) { int x; @@ -3820,11 +3769,7 @@ parse(arg, format, error) * Output COUNT*ELTSIZE bytes of data at BUF to the descriptor FD. */ void -mywrite(buf, count, eltsize, fd) - void *buf; - int count; - int eltsize; - FILE *fd; +mywrite(void *buf, int count, int eltsize, FILE *fd) { if (fwrite(buf, eltsize, count, fd) != count) @@ -3832,7 +3777,7 @@ mywrite(buf, count, eltsize, fd) } static void -cleanup() +cleanup(void) { struct stat statbuf; @@ -3852,9 +3797,7 @@ cleanup() * PADDING may be negative; in that case, do nothing. */ void -padfile(padding, fd) - int padding; - FILE *fd; +padfile(int padding, FILE *fd) { char *buf; if (padding <= 0) diff --git a/gnu/usr.bin/ld/ldconfig/ldconfig.c b/gnu/usr.bin/ld/ldconfig/ldconfig.c index d3748c5526a..6b85fd0670a 100644 --- a/gnu/usr.bin/ld/ldconfig/ldconfig.c +++ b/gnu/usr.bin/ld/ldconfig/ldconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldconfig.c,v 1.12 2002/07/17 20:33:29 marc Exp $ */ +/* $OpenBSD: ldconfig.c,v 1.13 2002/07/19 19:28:12 marc Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -86,9 +86,7 @@ static int readhints(void); static void listhints(void); int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int i, c; int rval = 0; @@ -171,9 +169,7 @@ char *argv[]; } int -dodir(dir, silent) -char *dir; -int silent; +dodir(char *dir, int silent) { DIR *dd; struct dirent *dp; @@ -226,9 +222,7 @@ int silent; } static void -enter(dir, file, name, dewey, ndewey) -char *dir, *file, *name; -int dewey[], ndewey; +enter(char *dir, char *file, char *name, int dewey[], int ndewey) { struct shlib_list *shp; @@ -282,9 +276,7 @@ int dewey[], ndewey; #endif int -hinthash(cp, vmajor, vminor) -char *cp; -int vmajor, vminor; +hinthash(char *cp, int vmajor, int vminor) { int k = 0; @@ -300,7 +292,7 @@ int vmajor, vminor; } int -buildhints() +buildhints(void) { struct hints_header hdr; struct hints_bucket *blist; @@ -431,7 +423,7 @@ buildhints() } static int -readhints() +readhints(void) { int fd; caddr_t addr; @@ -515,7 +507,7 @@ readhints() } static void -listhints() +listhints(void) { struct shlib_list *shp; int i; diff --git a/gnu/usr.bin/ld/ldd/ldd.c b/gnu/usr.bin/ld/ldd/ldd.c index 3d78cacb26b..2ae8f91295c 100644 --- a/gnu/usr.bin/ld/ldd/ldd.c +++ b/gnu/usr.bin/ld/ldd/ldd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldd.c,v 1.10 2002/07/15 21:05:57 marc Exp $ */ +/* $OpenBSD: ldd.c,v 1.11 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD: ldd.c,v 1.12 1995/10/09 00:14:41 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -48,7 +48,7 @@ extern void scan_library(int, struct exec *, const char *, const char *, const char *); void -usage() +usage(void) { extern char *__progname; @@ -57,9 +57,7 @@ usage() } int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { char *fmt1 = NULL, *fmt2 = NULL; int rval; diff --git a/gnu/usr.bin/ld/ldd/scanlib.c b/gnu/usr.bin/ld/ldd/scanlib.c index f9d0557dd33..a28e11ef7eb 100644 --- a/gnu/usr.bin/ld/ldd/scanlib.c +++ b/gnu/usr.bin/ld/ldd/scanlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scanlib.c,v 1.3 2002/07/15 21:05:57 marc Exp $ */ +/* $OpenBSD: scanlib.c,v 1.4 2002/07/19 19:28:12 marc Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -36,12 +36,8 @@ #include <link.h> void -scan_library(fd, hdr, name, fmt1, fmt2) - int fd; - struct exec *hdr; - const char *name; - const char *fmt1; - const char *fmt2; +scan_library(int fd, struct exec *hdr, const char *name, const char *fmt1, + const char *fmt2) { struct _dynamic dyn; struct section_dispatch_table sdt; diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c index 0a395c1c482..eaf3ce99e31 100644 --- a/gnu/usr.bin/ld/lib.c +++ b/gnu/usr.bin/ld/lib.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: lib.c,v 1.8 2002/07/17 20:33:29 marc Exp $ - library routines*/ +/* * $OpenBSD: lib.c,v 1.9 2002/07/19 19:28:11 marc Exp $ - library routines*/ /* */ @@ -36,9 +36,7 @@ static struct file_entry *decode_library_subfile(int, */ void -search_library(fd, entry) - int fd; - struct file_entry *entry; +search_library(int fd, struct file_entry *entry) { int member_length; char *name; @@ -71,11 +69,8 @@ search_library(fd, entry) */ static struct file_entry * -decode_library_subfile(fd, library_entry, subfile_offset, length_loc) - int fd; - struct file_entry *library_entry; - int subfile_offset; - int *length_loc; +decode_library_subfile(int fd, struct file_entry *library_entry, + int subfile_offset, int *length_loc) { int bytes_read; int namelen; @@ -166,10 +161,7 @@ static int subfile_wanted_p(struct file_entry *); */ static void -symdef_library(fd, entry, member_length) - int fd; - struct file_entry *entry; - int member_length; +symdef_library(int fd, struct file_entry *entry, int member_length) { int *symdef_data = (int *) xmalloc(member_length); struct ranlib *symdef_base; @@ -358,9 +350,7 @@ symdef_library(fd, entry, member_length) */ static void -linear_library(fd, entry) - int fd; - struct file_entry *entry; +linear_library(int fd, struct file_entry *entry) { struct file_entry *prev = 0; int this_subfile_offset = SARMAG; @@ -411,8 +401,7 @@ linear_library(fd, entry) */ static int -subfile_wanted_p(entry) - struct file_entry *entry; +subfile_wanted_p(struct file_entry *entry) { struct localsymbol *lsp, *lspend; #ifdef DOLLAR_KLUDGE @@ -582,9 +571,7 @@ subfile_wanted_p(entry) * open, on descriptor FD. */ void -read_shared_object(fd, entry) - struct file_entry *entry; - int fd; +read_shared_object(int fd, struct file_entry *entry) { struct _dynamic dyn; struct section_dispatch_table sdt; @@ -813,8 +800,7 @@ out: #undef minor int -findlib(p) -struct file_entry *p; +findlib(struct file_entry *p) { int i; int fd = -1; diff --git a/gnu/usr.bin/ld/m68k/md-static-funcs.c b/gnu/usr.bin/ld/m68k/md-static-funcs.c index c6944f33232..01c23d578f2 100644 --- a/gnu/usr.bin/ld/m68k/md-static-funcs.c +++ b/gnu/usr.bin/ld/m68k/md-static-funcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md-static-funcs.c,v 1.2 1998/03/26 19:46:58 niklas Exp $ */ +/* $OpenBSD: md-static-funcs.c,v 1.3 2002/07/19 19:28:12 marc Exp $ */ /* @@ -6,10 +6,7 @@ * This *must* be a static function, so it is not called through a jmpslot. */ static void -md_relocate_simple(r, relocation, addr) -struct relocation_info *r; -long relocation; -char *addr; +md_relocate_simple(struct relocation_info *r, long relocation, char *addr) { if (r->r_relative) { *(long *)addr += relocation; diff --git a/gnu/usr.bin/ld/m68k/md.c b/gnu/usr.bin/ld/m68k/md.c index 5ecf15f7abf..a31b2b6ecad 100644 --- a/gnu/usr.bin/ld/m68k/md.c +++ b/gnu/usr.bin/ld/m68k/md.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md.c,v 1.6 2002/07/15 21:05:57 marc Exp $*/ +/* * $OpenBSD: md.c,v 1.7 2002/07/19 19:28:12 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -46,9 +46,7 @@ * from address ADDR */ long -md_get_addend(rp, addr) -struct relocation_info *rp; -unsigned char *addr; +md_get_addend(struct relocation_info *rp, unsigned char *addr) { switch (RELOC_TARGET_SIZE(rp)) { case 0: @@ -67,11 +65,8 @@ unsigned char *addr; * Put RELOCATION at ADDR according to relocation record RP. */ void -md_relocate(rp, relocation, addr, relocatable_output) -struct relocation_info *rp; -long relocation; -unsigned char *addr; -int relocatable_output; +md_relocate(struct relocation_info *rp, long relocation, unsigned char *addr, + int relocatable_output) { switch (RELOC_TARGET_SIZE(rp)) { case 0: @@ -97,9 +92,7 @@ int relocatable_output; * Set RRS relocation type. */ int -md_make_reloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_reloc(struct relocation_info *rp, struct relocation_info *r, int type) { /* Relocation size */ r->r_length = rp->r_length; @@ -121,10 +114,7 @@ int type; * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) -jmpslot_t *sp; -long offset; -long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { /* * On m68k machines, a long branch offset is relative to @@ -149,10 +139,7 @@ long index; * further RRS relocations will be necessary for such a jmpslot. */ void -md_fix_jmpslot(sp, offset, addr) -jmpslot_t *sp; -long offset; -u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { u_long fudge = addr - (sizeof(sp->opcode) + offset); @@ -169,9 +156,8 @@ u_long addr; * Update the relocation record for a RRS jmpslot. */ void -md_make_jmpreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_jmpreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { jmpslot_t *sp; @@ -195,9 +181,8 @@ int type; * Set relocation type for a RRS GOT relocation. */ void -md_make_gotreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_gotreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { r->r_baserel = 1; if (type & RELTYPE_RELATIVE) @@ -211,8 +196,7 @@ int type; * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) -struct relocation_info *rp, *r; +md_make_cpyreloc(struct relocation_info *rp, struct relocation_info *r) { /* Relocation size */ r->r_length = 2; @@ -221,9 +205,7 @@ struct relocation_info *rp, *r; } void -md_set_breakpoint(where, savep) -long where; -long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(short *)where = BPT; @@ -235,9 +217,7 @@ long *savep; * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) -struct exec *hp; -int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { if (oldmagic) hp->a_midmag = oldmagic; @@ -253,8 +233,7 @@ int magic, flags; * Check for acceptable foreign machine Ids */ int -md_midcompat(hp) -struct exec *hp; +md_midcompat(struct exec *hp) { int mid = N_GETMID(*hp); @@ -279,8 +258,7 @@ struct exec *hp; */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { int skip = 0; @@ -291,8 +269,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD/OpenBSD: Always leave magic alone */ int skip = 1; @@ -306,9 +283,7 @@ struct exec *h; void -md_swapin_reloc(r, n) -struct relocation_info *r; -int n; +md_swapin_reloc(struct relocation_info *r, int n) { int bits; @@ -329,9 +304,7 @@ int n; } void -md_swapout_reloc(r, n) -struct relocation_info *r; -int n; +md_swapout_reloc(struct relocation_info *r, int n) { int bits; @@ -352,9 +325,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode = md_swap_short(j->opcode); diff --git a/gnu/usr.bin/ld/m88k/md.c b/gnu/usr.bin/ld/m88k/md.c index 1f838c3fb22..ac9eae4e0b8 100644 --- a/gnu/usr.bin/ld/m88k/md.c +++ b/gnu/usr.bin/ld/m88k/md.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md.c,v 1.3 2002/07/15 21:05:57 marc Exp $*/ +/* * $OpenBSD: md.c,v 1.4 2002/07/19 19:28:12 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -46,9 +46,7 @@ * from address ADDR */ long -md_get_addend(rp, addr) -struct relocation_info_m88k *rp; -unsigned char *addr; +md_get_addend(struct relocation_info_m88k *rp, unsigned char *addr) { return rp->r_addend; } @@ -57,10 +55,8 @@ unsigned char *addr; * Put RELOCATION at ADDR according to relocation record RP. */ void -md_relocate(rp, relocation, addr, relocatable_output) -struct relocation_info_m88k *rp; -long relocation; -unsigned char *addr; +md_relocate(struct relocation_info_m88k *rp, long relocation, + unsigned char *addr, int relocatable_output) { if (relocatable_output) { /* @@ -119,9 +115,8 @@ unsigned char *addr; * Set RRS relocation type. */ int -md_make_reloc(rp, r, type) -struct relocation_info_m88k *rp, *r; -int type; +md_make_reloc(struct relocation_info_m88k *rp, struct relocation_info_m88k *r, + int type) { r->r_address = rp->r_address; r->r_type = rp->r_type; @@ -140,10 +135,7 @@ int type; * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) -jmpslot_t *sp; -long offset; -long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { /* * On m68k machines, a long branch offset is relative to @@ -168,10 +160,7 @@ long index; * further RRS relocations will be necessary for such a jmpslot. */ void -md_fix_jmpslot(sp, offset, addr) -jmpslot_t *sp; -long offset; -u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { u_long fudge = addr - (sizeof(sp->opcode) + offset); @@ -188,9 +177,8 @@ u_long addr; * Update the relocation record for a RRS jmpslot. */ void -md_make_jmpreloc(rp, r, type) -struct relocation_info_m88k *rp, *r; -int type; +md_make_jmpreloc(struct relocation_info_m88k *rp, + struct relocation_info_m88k *r, int type) { jmpslot_t *sp; @@ -220,9 +208,8 @@ exit (15); * Set relocation type for a RRS GOT relocation. */ void -md_make_gotreloc(rp, r, type) -struct relocation_info_m88k *rp, *r; -int type; +md_make_gotreloc(struct relocation_info_m88k *rp, + struct relocation_info_m88k *r, int type) { #if 0 r->r_baserel = 1; @@ -240,8 +227,8 @@ exit (15); * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) -struct relocation_info_m88k *rp, *r; +md_make_cpyreloc(struct relocation_info_m88k *rp, + struct relocation_info_m88k *r) { r->r_address = rp->r_address; r->r_type = rp->r_type; @@ -254,9 +241,7 @@ struct relocation_info_m88k *rp, *r; } void -md_set_breakpoint(where, savep) -long where; -long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(short *)where = BPT; @@ -272,9 +257,7 @@ long *savep; * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) -struct exec *hp; -int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { if (oldmagic) hp->a_midmag = oldmagic; @@ -290,8 +273,7 @@ int magic, flags; * Check for acceptable foreign machine Ids */ int -md_midcompat(hp) -struct exec *hp; +md_midcompat(struct exec *hp) { int mid = N_GETMID(*hp); @@ -311,8 +293,7 @@ struct exec *hp; */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { int skip = 1; @@ -323,8 +304,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD: Always leave magic alone -- unless on little endian*/ int skip = 1; @@ -338,9 +318,7 @@ struct exec *h; void -md_swapin_reloc(r, n) -struct relocation_info_m88k *r; -int n; +md_swapin_reloc(struct relocation_info_m88k *r, int n) { struct r_relocation_info_m88k r_r; int *rev_int; @@ -388,9 +366,7 @@ printf("%08x: %5x %4x %4x\n", } void -md_swapout_reloc(r, n) -struct relocation_info_m88k *r; -int n; +md_swapout_reloc(struct relocation_info_m88k *r, int n) { int *rev_int; struct r_relocation_info_m88k r_r; @@ -408,9 +384,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode = md_swap_short(j->opcode); @@ -422,9 +396,7 @@ int n; #else /* ! defined(NEEDSWAP) */ void -md_in_reloc(r, n) -struct relocation_info_m88k *r; -int n; +md_in_reloc(struct relocation_info_m88k *r, int n) { for (; n; n--, r++) { diff --git a/gnu/usr.bin/ld/ns32k/md-static-funcs.c b/gnu/usr.bin/ld/ns32k/md-static-funcs.c index cd540daa284..03613cbf7e6 100644 --- a/gnu/usr.bin/ld/ns32k/md-static-funcs.c +++ b/gnu/usr.bin/ld/ns32k/md-static-funcs.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md-static-funcs.c,v 1.2 1998/03/26 19:47:12 niklas Exp $*/ +/* * $OpenBSD: md-static-funcs.c,v 1.3 2002/07/19 19:28:12 marc Exp $*/ /* * * Called by ld.so when onanating. @@ -19,10 +19,7 @@ asm(" movqd -1,r0"); asm("1: jump 0(0(sp))"); /* return */ static void -md_relocate_simple(r, relocation, addr) -struct relocation_info *r; -long relocation; -char *addr; +md_relocate_simple(struct relocation_info *r, long relocation, char *addr) { if (r->r_relative) { if (r->r_disp != 2) { diff --git a/gnu/usr.bin/ld/ns32k/md.c b/gnu/usr.bin/ld/ns32k/md.c index 10ecd59a011..4dd8626df66 100644 --- a/gnu/usr.bin/ld/ns32k/md.c +++ b/gnu/usr.bin/ld/ns32k/md.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md.c,v 1.4 2002/07/15 21:05:57 marc Exp $ */ +/* $OpenBSD: md.c,v 1.5 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD: md.c,v 1.6 1994/11/30 06:20:42 phil Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -46,10 +46,7 @@ * Put little endian VAL of size N at ADDR */ static void -put_num(addr, val, n) -unsigned char *addr; -long val; -char n; +put_num(unsigned char *addr, long val, char n) { while (n--) { *addr++ = val; @@ -61,9 +58,7 @@ char n; * Get little endian of size N at ADDR */ static unsigned long -get_num(addr, n) -unsigned char *addr; -int n; +get_num(unsigned char *addr, int n) { int val = 0; @@ -78,10 +73,7 @@ int n; * Put big endian VAL of size N at ADDR */ static void -put_imm(addr, val, n) -unsigned char *addr; -unsigned long val; -char n; +put_imm(unsigned char *addr, unsigned long val, char n) { addr += (n - 1); while (n--) { @@ -94,9 +86,7 @@ char n; * Get big endian of size N at ADDR */ static unsigned long -get_imm(addr, n) -unsigned char *addr; -int n; +get_imm(unsigned char *addr, int n) { int val = 0; @@ -118,8 +108,7 @@ int n; * Signextend VAL from bit N */ static long -sign_extend(val, n) -int val, n; +sign_extend(int val, int n) { val = val & ((1 << n) - 1); return (val & (1 << (n - 1))? @@ -133,10 +122,7 @@ int val, n; * Put ns32k displacement VAL of size N at ADDR */ static void -put_disp(addr, val, n) -unsigned char *addr; -long val; -char n; +put_disp(unsigned char *addr, long val, char n) { switch (n) { case 1: @@ -175,9 +161,7 @@ char n; * Get ns32k displacement size N at ADDR */ static unsigned long -get_disp(addr, n) -unsigned char *addr; -int n; +get_disp(unsigned char *addr, int n) { unsigned long Ivalue; @@ -217,9 +201,7 @@ int n; * from address ADDR */ long -md_get_addend(rp, addr) -struct relocation_info *rp; -unsigned char *addr; +md_get_addend(struct relocation_info *rp, unsigned char *addr) { int bytes = 1 << RELOC_TARGET_SIZE(rp); @@ -237,10 +219,8 @@ unsigned char *addr; * Put RELOCATION at ADDR according to relocation record RP. */ void -md_relocate(rp, relocation, addr, relocatable_output) -struct relocation_info *rp; -long relocation; -unsigned char *addr; +md_relocate(struct relocation_info *rp, long relocation, unsigned char *addr, + int relocatable_output) { int bytes = 1 << RELOC_TARGET_SIZE(rp); @@ -262,9 +242,7 @@ unsigned char *addr; * Set RRS relocation type. */ int -md_make_reloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_reloc(struct relocation_info *rp, struct relocation_info *r, int type) { /* Relocation size */ r->r_length = rp->r_length; @@ -289,10 +267,7 @@ int type; * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) -jmpslot_t *sp; -long offset; -long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { /* * On ns32k machines, a long branch offset is relative to @@ -315,10 +290,7 @@ long index; * further RRS relocations will be necessary for such a jmpslot. */ void -md_fix_jmpslot(sp, offset, addr) -jmpslot_t *sp; -long offset; -u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { put_num(sp->code, BR, 2); put_disp(sp->code + 2, addr - offset - 1, 4); @@ -332,9 +304,8 @@ u_long addr; * Update the relocation record for a RRS jmpslot. */ void -md_make_jmpreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_jmpreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { jmpslot_t *sp; @@ -361,9 +332,8 @@ int type; * Set relocation type for a RRS GOT relocation. */ void -md_make_gotreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_gotreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { r->r_baserel = 1; if (type & RELTYPE_RELATIVE) @@ -380,8 +350,7 @@ int type; * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) -struct relocation_info *rp, *r; +md_make_cpyreloc(struct relocation_info *rp, struct relocation_info *r) { /* Relocation size */ r->r_length = 2; @@ -393,9 +362,7 @@ struct relocation_info *rp, *r; } void -md_set_breakpoint(where, savep) -long where; -long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(short *)where = BPT; @@ -407,9 +374,7 @@ long *savep; * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) -struct exec *hp; -int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { if (oldmagic) hp->a_midmag = oldmagic; @@ -429,8 +394,7 @@ int magic, flags; */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { int skip = 0; @@ -441,8 +405,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD/OpenBSD: Always leave magic alone */ int skip = 1; @@ -456,9 +419,7 @@ struct exec *h; void -md_swapin_reloc(r, n) -struct relocation_info *r; -int n; +md_swapin_reloc(struct relocation_info *r, int n) { int bits; @@ -480,9 +441,7 @@ int n; } void -md_swapout_reloc(r, n) -struct relocation_info *r; -int n; +md_swapout_reloc(struct relocation_info *r, int n) { int bits; @@ -503,9 +462,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode = md_swap_short(j->opcode); diff --git a/gnu/usr.bin/ld/rrs.c b/gnu/usr.bin/ld/rrs.c index 29fc410cf3f..489637d8623 100644 --- a/gnu/usr.bin/ld/rrs.c +++ b/gnu/usr.bin/ld/rrs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrs.c,v 1.8 2002/07/15 21:05:56 marc Exp $*/ +/* $OpenBSD: rrs.c,v 1.9 2002/07/19 19:28:11 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -146,7 +146,7 @@ RRS data segment: */ static int -dlopen_is_used() +dlopen_is_used(void) { symbol *sym; struct localsymbol *lsp; @@ -175,8 +175,7 @@ dlopen_is_used() * Return 1 if ENTRY was added to the list. */ int -rrs_add_shobj(entry) - struct file_entry *entry; +rrs_add_shobj(struct file_entry *entry) { struct shobj **p; @@ -192,9 +191,7 @@ rrs_add_shobj(entry) } void -alloc_rrs_reloc(entry, sp) - struct file_entry *entry; - symbol *sp; +alloc_rrs_reloc(struct file_entry *entry, symbol *sp) { #ifdef DEBUG printf("alloc_rrs_reloc: %s in %s\n", sp->name, get_file_name(entry)); @@ -203,9 +200,7 @@ printf("alloc_rrs_reloc: %s in %s\n", sp->name, get_file_name(entry)); } void -alloc_rrs_segment_reloc(entry, r) - struct file_entry *entry; - struct relocation_info *r; +alloc_rrs_segment_reloc(struct file_entry *entry, struct relocation_info *r) { #ifdef DEBUG printf("alloc_rrs_segment_reloc at %#x in %s\n", @@ -215,9 +210,7 @@ printf("alloc_rrs_segment_reloc at %#x in %s\n", } void -alloc_rrs_jmpslot(entry, sp) - struct file_entry *entry; - symbol *sp; +alloc_rrs_jmpslot(struct file_entry *entry, symbol *sp) { if (sp->flags & GS_HASJMPSLOT) return; @@ -228,10 +221,8 @@ alloc_rrs_jmpslot(entry, sp) } void -alloc_rrs_gotslot(entry, r, lsp) - struct file_entry *entry; - struct relocation_info *r; - struct localsymbol *lsp; +alloc_rrs_gotslot(struct file_entry *entry, struct relocation_info *r, + struct localsymbol *lsp) { symbol *sp = lsp->symbol; @@ -276,9 +267,7 @@ alloc_rrs_gotslot(entry, r, lsp) } void -alloc_rrs_cpy_reloc(entry, sp) - struct file_entry *entry; - symbol *sp; +alloc_rrs_cpy_reloc(struct file_entry *entry, symbol *sp) { if (sp->flags & GS_CPYRELOCRESERVED) return; @@ -290,7 +279,7 @@ printf("alloc_rrs_copy: %s in %s\n", sp->name, get_file_name(entry)); } static struct relocation_info * -rrs_next_reloc() +rrs_next_reloc(void) { struct relocation_info *r; @@ -307,7 +296,7 @@ static unsigned long total_text_relocs = 0; /* called at cleanup time */ void -rrs_summarize_warnings() +rrs_summarize_warnings(void) { if (total_text_relocs >= TEXT_RELOC_THRESHOLD) warnx("Total: %lu RRS text relocations", @@ -323,11 +312,8 @@ rrs_summarize_warnings() * written to a.out. */ int -claim_rrs_reloc(entry, rp, sp, relocation) - struct file_entry *entry; - struct relocation_info *rp; - symbol *sp; - long *relocation; +claim_rrs_reloc(struct file_entry *entry, struct relocation_info *rp, + symbol *sp, long *relocation) { struct relocation_info *r = rrs_next_reloc(); @@ -360,11 +346,8 @@ printf("claim_rrs_reloc: %s in %s\n", sp->name, get_file_name(entry)); * Claim a jmpslot. Setup RRS relocation if claimed for the first time. */ long -claim_rrs_jmpslot(entry, rp, sp, addend) - struct file_entry *entry; - struct relocation_info *rp; - symbol *sp; - long addend; +claim_rrs_jmpslot(struct file_entry *entry, struct relocation_info *rp, + symbol *sp, long addend) { struct relocation_info *r; @@ -431,11 +414,8 @@ printf("claim_rrs_jmpslot: %s: %s(%d) -> offset %x\n", * Return offset into the GOT allocated to this symbol. */ long -claim_rrs_gotslot(entry, rp, lsp, addend) - struct file_entry *entry; - struct relocation_info *rp; - struct localsymbol *lsp; - long addend; +claim_rrs_gotslot(struct file_entry *entry, struct relocation_info *rp, + struct localsymbol *lsp, long addend) { struct relocation_info *r; symbol *sp = lsp->symbol; @@ -549,11 +529,8 @@ printf("claim_rrs_gotslot: %s(%d,%#x) slot offset %#x, addend %#x\n", * the GOT. */ long -claim_rrs_internal_gotslot(entry, rp, lsp, addend) - struct file_entry *entry; - struct relocation_info *rp; - struct localsymbol *lsp; - long addend; +claim_rrs_internal_gotslot(struct file_entry *entry, struct relocation_info *rp, + struct localsymbol *lsp, long addend) { struct relocation_info *r; @@ -609,10 +586,8 @@ printf("claim_rrs_internal_gotslot: %s: slot offset %#x, addend = %#x\n", } void -claim_rrs_cpy_reloc(entry, rp, sp) - struct file_entry *entry; - struct relocation_info *rp; - symbol *sp; +claim_rrs_cpy_reloc(struct file_entry *entry, struct relocation_info *rp, + symbol *sp) { struct relocation_info *r; @@ -638,9 +613,7 @@ printf("claim_rrs_copy: %s: %s -> %x\n", } void -claim_rrs_segment_reloc(entry, rp) - struct file_entry *entry; - struct relocation_info *rp; +claim_rrs_segment_reloc(struct file_entry *entry, struct relocation_info *rp) { struct relocation_info *r = rrs_next_reloc(); @@ -661,9 +634,7 @@ printf("claim_rrs_segment_reloc: %s at %#x\n", * NOTE: the hash value computation must match the one in rtld. */ void -rrs_insert_hash(cp, index) - char *cp; - int index; +rrs_insert_hash(char *cp, int index) { int hashval = 0; struct rrs_hash *hp; @@ -702,7 +673,7 @@ rrs_insert_hash(cp, index) * goes into a.out. */ void -consider_rrs_section_lengths() +consider_rrs_section_lengths(void) { int n; struct shobj *shp, **shpp; @@ -886,7 +857,7 @@ consider_rrs_section_lengths() } void -relocate_rrs_addresses() +relocate_rrs_addresses(void) { int gotsize; @@ -977,7 +948,7 @@ relocate_rrs_addresses() } void -write_rrs_data() +write_rrs_data(void) { long pos; @@ -1019,7 +990,7 @@ write_rrs_data() } void -write_rrs_text() +write_rrs_text(void) { long pos; int i; @@ -1268,7 +1239,7 @@ write_rrs_text() } void -write_rrs() +write_rrs(void) { /* diff --git a/gnu/usr.bin/ld/rtld/malloc.c b/gnu/usr.bin/ld/rtld/malloc.c index e611c370cc6..9d5869f3319 100644 --- a/gnu/usr.bin/ld/rtld/malloc.c +++ b/gnu/usr.bin/ld/rtld/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.4 2002/07/15 21:05:57 marc Exp $ */ +/* $OpenBSD: malloc.c,v 1.5 2002/07/19 19:28:12 marc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/ -static char *rcsid = "$OpenBSD: malloc.c,v 1.4 2002/07/15 21:05:57 marc Exp $"; +static char *rcsid = "$OpenBSD: malloc.c,v 1.5 2002/07/19 19:28:12 marc Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -68,9 +68,6 @@ static char *rcsid = "$OpenBSD: malloc.c,v 1.4 2002/07/15 21:05:57 marc Exp $"; #define NULL 0 -static void morecore(); -static int findbucket(); - /* * Pre-allocate mmap'ed pages */ @@ -113,6 +110,9 @@ union overhead { #define RSLOP 0 #endif +static void morecore(int); +static int findbucket(union overhead *freep, int srchlen); + /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The * smallest allocatable block is 8 bytes. The overhead information @@ -150,8 +150,7 @@ botch(s) #endif void * -malloc(nbytes) - size_t nbytes; +malloc(size_t nbytes) { union overhead *op; int bucket, n; @@ -236,8 +235,7 @@ malloc(nbytes) * Allocate more memory to the indicated bucket. */ static void -morecore(bucket) - int bucket; +morecore(int bucket) { union overhead *op; int sz; /* size of desired block */ @@ -280,8 +278,7 @@ morecore(bucket) } void -free(cp) - void *cp; +free(void *cp) { int size; union overhead *op; @@ -322,9 +319,7 @@ free(cp) int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ void * -realloc(cp, nbytes) - void *cp; - size_t nbytes; +realloc(void *cp, size_t nbytes) { u_int onb; int i; @@ -393,9 +388,7 @@ realloc(cp, nbytes) * Return bucket number, or -1 if not found. */ static -findbucket(freep, srchlen) - union overhead *freep; - int srchlen; +findbucket(union overhead *freep, int srchlen) { union overhead *p; int i, j; @@ -419,8 +412,7 @@ findbucket(freep, srchlen) * for each size category, the second showing the number of mallocs - * frees for each size category. */ -mstats(s) - char *s; +mstats(char *s) { int i, j; union overhead *p; @@ -446,8 +438,7 @@ mstats(s) static int -morepages(n) -int n; +morepages(int n) { int fd = -1; int offset; diff --git a/gnu/usr.bin/ld/rtld/md-prologue.c b/gnu/usr.bin/ld/rtld/md-prologue.c index 1422bec291d..e19a4990db7 100644 --- a/gnu/usr.bin/ld/rtld/md-prologue.c +++ b/gnu/usr.bin/ld/rtld/md-prologue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md-prologue.c,v 1.3 2002/07/10 17:28:16 marc Exp $ */ +/* $OpenBSD: md-prologue.c,v 1.4 2002/07/19 19:28:12 marc Exp $ */ /* * rtld entry pseudo code - turn into assembler and tweak it @@ -15,9 +15,7 @@ extern void (*rtld)(); extern void (*binder())(); void -rtld_entry(version, crtp) -int version; -struct crt *crtp; +rtld_entry(int version, struct crt *crtp) { struct link_dynamic *dp; void (*f)(); @@ -30,7 +28,7 @@ struct crt *crtp; } void -binder_entry() +binder_entry(void) { extern int PC; struct jmpslot *sp; diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index f3082588842..296cf4e8e58 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld.c,v 1.26 2002/07/17 20:33:29 marc Exp $ */ +/* $OpenBSD: rtld.c,v 1.27 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -217,10 +217,7 @@ strcmp (const char *s1, const char *s2) * and dp (our __DYNAMIC). */ int -rtld(version, crtp, dp) - int version; - struct crt_ldso *crtp; - struct _dynamic *dp; +rtld(int version, struct crt_ldso *crtp, struct _dynamic *dp) { int n; int nreloc; /* # of ld.so relocations */ @@ -248,7 +245,7 @@ rtld(version, crtp, dp) for (reloc = (struct relocation_info *)(LD_REL(dp) + crtp->crt_ba); nreloc; nreloc--, reloc++) { long addr = reloc->r_address + crtp->crt_ba; - md_relocate_simple(reloc, crtp->crt_ba, addr); + md_relocate_simple(reloc, crtp->crt_ba, (char*)addr); } if (version >= CRT_VERSION_BSD_4) @@ -351,8 +348,7 @@ rtld(version, crtp, dp) static int -load_subs(smp) - struct so_map *smp; +load_subs(struct so_map *smp) { for (; smp; smp = smp->som_next) { @@ -391,8 +387,7 @@ load_subs(smp) } void -ld_trace(smp) - struct so_map *smp; +ld_trace(struct so_map *smp) { char *fmt1, *fmt2, *fmt, *main_local; int c; @@ -480,13 +475,8 @@ ld_trace(smp) * result of the presence of link object LOP in the link map PARENT. */ static struct so_map * -alloc_link_map(path, sodp, parent, addr, size, dp) - char *path; - struct sod *sodp; - struct so_map *parent; - caddr_t addr; - size_t size; - struct _dynamic *dp; +alloc_link_map(char *path, struct sod *sodp, struct so_map *parent, + caddr_t addr, size_t size, struct _dynamic *dp) { struct so_map *smp; struct somap_private *smpp; @@ -523,8 +513,7 @@ alloc_link_map(path, sodp, parent, addr, size, dp) * after it's been unmapped. */ static void -free_link_map(smp) - struct so_map *smp; +free_link_map(struct so_map *smp) { if ((LM_PRIVATE(smp)->spd_flags & RTLD_DL) != 0) { @@ -545,9 +534,7 @@ free_link_map(smp) * in link map SMP. */ static struct so_map * -map_object(sodp, smp) - struct sod *sodp; - struct so_map *smp; +map_object(struct sod *sodp, struct so_map *smp) { char *name; struct _dynamic *dp; @@ -659,8 +646,7 @@ again: * Unmap a mapped object. */ static void -unmap_object(smp) - struct so_map *smp; +unmap_object(struct so_map *smp) { struct so_map *p, **pp; @@ -686,8 +672,7 @@ unmap_object(smp) } void -init_maps(head) - struct so_map *head; +init_maps(struct so_map *head) { struct so_map *smp; @@ -716,10 +701,7 @@ init_maps(head) } static inline void -check_text_reloc(r, smp, addr) - struct relocation_info *r; - struct so_map *smp; - caddr_t addr; +check_text_reloc(struct relocation_info *r, struct so_map *smp, caddr_t addr) { char *sym; @@ -749,8 +731,7 @@ check_text_reloc(r, smp, addr) } static void -reloc_map(smp) - struct so_map *smp; +reloc_map(struct so_map *smp) { struct _dynamic *dp = smp->som_dynamic; struct relocation_info *r = LM_REL(smp); @@ -841,8 +822,7 @@ reloc_map(smp) } static void -reloc_copy(smp) - struct so_map *smp; +reloc_copy(struct so_map *smp) { struct rt_symbol *rtsp; @@ -855,9 +835,7 @@ reloc_copy(smp) } static void -call_map(smp, sym) - struct so_map *smp; - char *sym; +call_map(struct so_map *smp, char *sym) { struct so_map *src_map = smp; struct nzlist *np; @@ -878,8 +856,7 @@ static struct rt_symbol *rt_symtab[RTC_TABSIZE]; * Compute hash value for run-time symbol table */ static inline int -hash_string(key) - const char *key; +hash_string(const char *key) { const char *cp; int k; @@ -897,8 +874,7 @@ hash_string(key) */ static inline struct rt_symbol * -lookup_rts(key) - const char *key; +lookup_rts(const char *key) { int hashval; struct rt_symbol *rtsp; @@ -917,13 +893,8 @@ lookup_rts(key) } static struct rt_symbol * -enter_rts(name, value, type, srcaddr, size, smp) - const char *name; - long value; - int type; - caddr_t srcaddr; - long size; - struct so_map *smp; +enter_rts(const char *name, long value, int type, caddr_t srcaddr, long size, + struct so_map *smp) { int hashval; struct rt_symbol *rtsp, **rpp; @@ -963,10 +934,7 @@ enter_rts(name, value, type, srcaddr, size, smp) * have a proper type (used by binder()). */ static struct nzlist * -lookup(name, src_map, strong) - const char *name; - struct so_map **src_map; /* IN/OUT */ - int strong; +lookup(const char *name, struct so_map **src_map, int strong) { long common_size = 0; struct so_map *smp, *weak_smp; @@ -1111,8 +1079,7 @@ xprintf("Allocating common: %s size %d at %#x\n", name, common_size, rtsp->rt_sp * procedure calls to shared objects. */ long -binder(jsp) - jmpslot_t *jsp; +binder(jmpslot_t *jsp) { struct so_map *smp, *src_map = NULL; long addr; @@ -1167,7 +1134,7 @@ static char *hint_search_path = ""; #define HINTS_VALID (hheader != NULL && hheader != (struct hints_header *)-1) static void -maphints() +maphints(void) { caddr_t addr; @@ -1220,7 +1187,7 @@ maphints() } static void -unmaphints() +unmaphints(void) { if (HINTS_VALID) { @@ -1231,9 +1198,7 @@ unmaphints() } int -hinthash(cp, vmajor, vminor) - char *cp; - int vmajor, vminor; +hinthash(char *cp, int vmajor, int vminor) { int k = 0; @@ -1251,10 +1216,7 @@ hinthash(cp, vmajor, vminor) #undef minor static char * -findhint(name, major, minor, prefered_path) - char *name; - int major, minor; - char *prefered_path; +findhint(char *name, int major, int minor, char *prefered_path) { struct hints_bucket *bp; @@ -1296,11 +1258,7 @@ findhint(name, major, minor, prefered_path) } static char * -rtfindlib(name, major, minor, usehints, ipath) - char *name; - int major, minor; - int *usehints; - char *ipath; +rtfindlib(char *name, int major, int minor, int *usehints, char *ipath) { char *cp; int realminor; @@ -1367,8 +1325,7 @@ lose: } void -preload(paths) - char *paths; +preload(char *paths) { struct so_map *nsmp; struct sod *sodp; @@ -1423,9 +1380,7 @@ static int dlerrno; * Populate sod struct for dlopen's call to map_object */ void -build_sod(name, sodp) - const char *name; - struct sod *sodp; +build_sod(const char *name, struct sod *sodp) { unsigned int tuplet; int major, minor; @@ -1497,9 +1452,7 @@ backout: } static void * -__dlopen(name, mode) - const char *name; - int mode; +__dlopen(const char *name, int mode) { struct sod *sodp; struct so_map *smp; @@ -1550,8 +1503,7 @@ xprintf("%s: %s\n", name, strerror(errno)); } static int -__dlclose(fd) - void *fd; +__dlclose(void *fd) { struct so_map *smp = (struct so_map *)fd; @@ -1576,9 +1528,7 @@ xprintf("dlclose(%s): refcount = %d\n", smp->som_path, LM_PRIVATE(smp)->spd_refc } static void * -__dlsym(fd, sym) - void *fd; - const char *sym; +__dlsym(void *fd, const char *sym) { struct so_map *smp = (struct so_map *)fd, *src_map = NULL; struct nzlist *np; @@ -1605,9 +1555,7 @@ __dlsym(fd, sym) } static int -__dlctl(fd, cmd, arg) - void *fd, *arg; - int cmd; +__dlctl(void *fd, int cmd, void *arg) { switch (cmd) { case DL_GETERRNO: @@ -1622,7 +1570,7 @@ __dlctl(fd, cmd, arg) } static void -__dlexit() +__dlexit(void) { struct so_map *smp; diff --git a/gnu/usr.bin/ld/shlib.c b/gnu/usr.bin/ld/shlib.c index 1456a172115..c8a170943b0 100644 --- a/gnu/usr.bin/ld/shlib.c +++ b/gnu/usr.bin/ld/shlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shlib.c,v 1.12 2002/07/15 21:05:56 marc Exp $ */ +/* $OpenBSD: shlib.c,v 1.13 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */ /* @@ -74,8 +74,7 @@ char *standard_search_dirs[] = { void -add_search_dir(name) - char *name; +add_search_dir(char *name) { int i, len; @@ -96,8 +95,7 @@ add_search_dir(name) } void -remove_search_dir(name) - char *name; +remove_search_dir(char *name) { int i, len; @@ -122,8 +120,7 @@ remove_search_dir(name) } void -add_search_path(path) -char *path; +add_search_path(char *path) { char *cp, *dup; @@ -138,8 +135,7 @@ char *path; } void -remove_search_path(path) -char *path; +remove_search_path(char *path) { char *cp, *dup; @@ -154,7 +150,7 @@ char *path; } void -std_search_path() +std_search_path(void) { int i, n; @@ -171,9 +167,7 @@ std_search_path() */ int -getdewey(dewey, cp) -int dewey[]; -char *cp; +getdewey(int dewey[], char *cp) { int i, n; @@ -202,9 +196,7 @@ char *cp; * Return 0 if equal. */ int -cmpndewey(d1, n1, d2, n2) -int d1[], d2[]; -int n1, n2; +cmpndewey(int d1[], int n1, int d2[], int n2) { int i; @@ -243,10 +235,7 @@ int n1, n2; #undef minor char * -findshlib(name, majorp, minorp, do_dot_a) -char *name; -int *majorp, *minorp; -int do_dot_a; +findshlib(char *name, int *majorp, int *minorp, int do_dot_a) { int dewey[MAXDEWEY]; int ndewey; diff --git a/gnu/usr.bin/ld/sparc/md-static-funcs.c b/gnu/usr.bin/ld/sparc/md-static-funcs.c index be591b3f9e5..e73fa50b468 100644 --- a/gnu/usr.bin/ld/sparc/md-static-funcs.c +++ b/gnu/usr.bin/ld/sparc/md-static-funcs.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md-static-funcs.c,v 1.3 2002/07/10 17:28:16 marc Exp $*/ +/* * $OpenBSD: md-static-funcs.c,v 1.4 2002/07/19 19:28:12 marc Exp $*/ /* * @@ -9,10 +9,7 @@ * This *must* be a static function, so it is not called through a jmpslot. */ static void -md_relocate_simple(r, relocation, addr) -struct relocation_info *r; -long relocation; -char *addr; +md_relocate_simple(struct relocation_info *r, long relocation, char *addr) { unsigned long mask; unsigned long shift; diff --git a/gnu/usr.bin/ld/sparc/md.c b/gnu/usr.bin/ld/sparc/md.c index aec03c36294..78a8ad4ab71 100644 --- a/gnu/usr.bin/ld/sparc/md.c +++ b/gnu/usr.bin/ld/sparc/md.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: md.c,v 1.9 2002/07/15 21:05:57 marc Exp $*/ +/* * $OpenBSD: md.c,v 1.10 2002/07/19 19:28:12 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -89,8 +89,7 @@ static int reloc_target_bitsize[] = { }; static __inline void -iflush(sp) - jmpslot_t *sp; +iflush(jmpslot_t *sp) { /* for a CROSS_LINKER, no rtld, so iflush is a nop, which is fortunate */ #ifndef CROSS_LINKER @@ -105,19 +104,14 @@ iflush(sp) * ADDR unused by SPARC impl. */ long -md_get_addend(r, addr) - struct relocation_info *r; - unsigned char *addr; +md_get_addend(struct relocation_info *r, unsigned char *addr) { return r->r_addend; } void -md_relocate(r, relocation, addr, relocatable_output) - struct relocation_info *r; - long relocation; - unsigned char *addr; - int relocatable_output; +md_relocate(struct relocation_info *r, long relocation, unsigned char *addr, + int relocatable_output) { unsigned long mask; @@ -176,9 +170,7 @@ md_relocate(r, relocation, addr, relocatable_output) * On the Sparc the relocation offsets are stored in the r_addend member. */ int -md_make_reloc(rp, r, type) - struct relocation_info *rp, *r; - int type; +md_make_reloc(struct relocation_info *rp, struct relocation_info *r, int type) { r->r_type = rp->r_type; r->r_addend = rp->r_addend; @@ -208,10 +200,7 @@ md_make_reloc(rp, r, type) * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) - jmpslot_t *sp; - long offset; - long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { u_long fudge = (u_long) -(sizeof(sp->opcode1) + offset); sp->opcode1 = SAVE; @@ -231,10 +220,7 @@ md_make_jmpslot(sp, offset, index) * OFFSET unused on Sparc. */ void -md_fix_jmpslot(sp, offset, addr) - jmpslot_t *sp; - long offset; - u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { /* * Here comes a RELOC_{LO10,HI22} relocation pair @@ -253,9 +239,8 @@ md_fix_jmpslot(sp, offset, addr) * Update the relocation record for a jmpslot. */ void -md_make_jmpreloc(rp, r, type) - struct relocation_info *rp, *r; - int type; +md_make_jmpreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { if (type & RELTYPE_RELATIVE) r->r_type = RELOC_RELATIVE; @@ -269,9 +254,8 @@ md_make_jmpreloc(rp, r, type) * Set relocation type for a GOT RRS relocation. */ void -md_make_gotreloc(rp, r, type) - struct relocation_info *rp, *r; - int type; +md_make_gotreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { /* * GOT value resolved (symbolic or entry point): R_32 @@ -291,17 +275,14 @@ md_make_gotreloc(rp, r, type) * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) - struct relocation_info *rp, *r; +md_make_cpyreloc(struct relocation_info *rp, struct relocation_info *r) { r->r_type = RELOC_COPY_DAT; r->r_addend = 0; } void -md_set_breakpoint(where, savep) - long where; - long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(long *)where = TRAP; @@ -313,9 +294,7 @@ md_set_breakpoint(where, savep) * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) - struct exec *hp; - int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { #if defined(__NetBSD__) || defined(__OpenBSD__) N_SETMAGIC((*hp), magic, MID_MACHINE, flags); @@ -339,8 +318,7 @@ md_init_header(hp, magic, flags) * Check for acceptable foreign machine Ids */ int -md_midcompat(hp) - struct exec *hp; +md_midcompat(struct exec *hp) { #if defined(__NetBSD__) || defined(__OpenBSD__) #define SUN_M_SPARC 3 @@ -357,8 +335,7 @@ md_midcompat(hp) */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { int skip = 0; @@ -369,8 +346,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD/OpenBSD: Always leave magic alone */ int skip = 1; @@ -383,9 +359,7 @@ struct exec *h; } void -md_swapin_reloc(r, n) -struct relocation_info *r; -int n; +md_swapin_reloc(struct relocation_info *r, int n) { int bits; @@ -400,9 +374,7 @@ int n; } void -md_swapout_reloc(r, n) -struct relocation_info *r; -int n; +md_swapout_reloc(struct relocation_info *r, int n) { int bits; @@ -417,9 +389,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode1 = md_swap_long(j->opcode1); diff --git a/gnu/usr.bin/ld/symbol.c b/gnu/usr.bin/ld/symbol.c index 70c9ba83f06..b123404f2f0 100644 --- a/gnu/usr.bin/ld/symbol.c +++ b/gnu/usr.bin/ld/symbol.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: symbol.c,v 1.5 2002/07/10 17:28:16 marc Exp $ - symbol table routines*/ +/* * $OpenBSD: symbol.c,v 1.6 2002/07/19 19:28:12 marc Exp $ - symbol table routines*/ /* */ @@ -25,8 +25,7 @@ symbol *got_symbol; /* the symbol __GLOBAL_OFFSET_TABLE_ */ symbol *dynamic_symbol; /* the symbol __DYNAMIC */ void -symtab_init(relocatable_output) - int relocatable_output; +symtab_init(int relocatable_output) { /* * Put linker reserved symbols into symbol table. @@ -74,8 +73,7 @@ symtab_init(relocatable_output) */ int -hash_string (key) - char *key; +hash_string(char *key) { char *cp; int k; @@ -94,8 +92,7 @@ hash_string (key) */ symbol * -getsym(key) - char *key; +getsym(char *key) { int hashval; symbol *bp; @@ -147,8 +144,7 @@ getsym(key) /* Like `getsym' but return 0 if the symbol is not already known. */ symbol * -getsym_soft (key) - char *key; +getsym_soft(char *key) { int hashval; symbol *bp; diff --git a/gnu/usr.bin/ld/vax/md-static-funcs.c b/gnu/usr.bin/ld/vax/md-static-funcs.c index bac3ef8f340..c156eee51bf 100644 --- a/gnu/usr.bin/ld/vax/md-static-funcs.c +++ b/gnu/usr.bin/ld/vax/md-static-funcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md-static-funcs.c,v 1.1 1996/07/27 10:39:58 maja Exp $ */ +/* $OpenBSD: md-static-funcs.c,v 1.2 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD: md-static-funcs.c,v 1.1 1995/10/19 13:10:17 ragge Exp $ */ /* * Called by ld.so when onanating. @@ -6,12 +6,9 @@ */ static void -md_relocate_simple(r, relocation, addr) -struct relocation_info *r; -long relocation; -char *addr; +md_relocate_simple(struct relocation_info *r, long relocation, char *addr) { -if (r->r_relative) - *(long *)addr += relocation; + if (r->r_relative) + *(long *)addr += relocation; } diff --git a/gnu/usr.bin/ld/vax/md.c b/gnu/usr.bin/ld/vax/md.c index 482316d1659..eb8797cdafa 100644 --- a/gnu/usr.bin/ld/vax/md.c +++ b/gnu/usr.bin/ld/vax/md.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md.c,v 1.4 2002/07/15 21:05:57 marc Exp $ */ +/* $OpenBSD: md.c,v 1.5 2002/07/19 19:28:12 marc Exp $ */ /* $NetBSD: md.c,v 1.1 1995/10/19 13:10:19 ragge Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -49,9 +49,7 @@ * from address ADDR */ long -md_get_addend(rp, addr) -struct relocation_info *rp; -unsigned char *addr; +md_get_addend(struct relocation_info *rp, unsigned char *addr) { switch (RELOC_TARGET_SIZE(rp)) { case 0: @@ -70,11 +68,8 @@ unsigned char *addr; * Put RELOCATION at ADDR according to relocation record RP. */ void -md_relocate(rp, relocation, addr, relocatable_output) -struct relocation_info *rp; -long relocation; -unsigned char *addr; -int relocatable_output; +md_relocate(struct relocation_info *rp, long relocation, unsigned char *addr, + int relocatable_output) { switch (RELOC_TARGET_SIZE(rp)) { case 0: @@ -97,9 +92,7 @@ int relocatable_output; * Set RRS relocation type. */ int -md_make_reloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_reloc(struct relocation_info *rp, struct relocation_info *r, int type) { /* Relocation size */ r->r_length = rp->r_length; @@ -121,10 +114,7 @@ int type; * to the binder slot (which is at offset 0 of the PLT). */ void -md_make_jmpslot(sp, offset, index) -jmpslot_t *sp; -long offset; -long index; +md_make_jmpslot(jmpslot_t *sp, long offset, long index) { /* * On VAX a branch offset given in immediate mode is relative to @@ -150,10 +140,7 @@ long index; * further RRS relocations will be necessary for such a jmpslot. */ void -md_fix_jmpslot(sp, offset, addr) -jmpslot_t *sp; -long offset; -u_long addr; +md_fix_jmpslot(jmpslot_t *sp, long offset, u_long addr) { u_long fudge = addr - (sizeof(sp->opcode) + sizeof(sp->addr) + offset); @@ -171,9 +158,8 @@ u_long addr; * Update the relocation record for a RRS jmpslot. */ void -md_make_jmpreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_jmpreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { jmpslot_t *sp; @@ -197,9 +183,8 @@ int type; * Set relocation type for a RRS GOT relocation. */ void -md_make_gotreloc(rp, r, type) -struct relocation_info *rp, *r; -int type; +md_make_gotreloc(struct relocation_info *rp, struct relocation_info *r, + int type) { r->r_baserel = 1; if (type & RELTYPE_RELATIVE) @@ -213,8 +198,7 @@ int type; * Set relocation type for a RRS copy operation. */ void -md_make_cpyreloc(rp, r) -struct relocation_info *rp, *r; +md_make_cpyreloc(struct relocation_info *rp, struct relocation_info *r) { /* Relocation size */ r->r_length = 2; @@ -223,9 +207,7 @@ struct relocation_info *rp, *r; } void -md_set_breakpoint(where, savep) -long where; -long *savep; +md_set_breakpoint(long where, long *savep) { *savep = *(long *)where; *(char *)where = TRAP; /* !!! fixit !!! */ @@ -242,9 +224,7 @@ int netzmagic; * obtained from subsequent N_*() macro evaluations. */ void -md_init_header(hp, magic, flags) -struct exec *hp; -int magic, flags; +md_init_header(struct exec *hp, int magic, int flags) { #if defined(__NetBSD__) || defined(__OpenBSD__) if (oldmagic || magic == QMAGIC) @@ -274,8 +254,7 @@ int magic, flags; */ void -md_swapin_exec_hdr(h) -struct exec *h; +md_swapin_exec_hdr(struct exec *h) { int skip = 0; @@ -286,8 +265,7 @@ struct exec *h; } void -md_swapout_exec_hdr(h) -struct exec *h; +md_swapout_exec_hdr(struct exec *h) { /* NetBSD/OpenBSD: Always leave magic alone */ int skip = 1; @@ -301,9 +279,7 @@ struct exec *h; void -md_swapin_reloc(r, n) -struct relocation_info *r; -int n; +md_swapin_reloc(struct relocation_info *r, int n) { int bits; @@ -324,9 +300,7 @@ int n; } void -md_swapout_reloc(r, n) -struct relocation_info *r; -int n; +md_swapout_reloc(struct relocation_info *r, int n) { int bits; @@ -347,9 +321,7 @@ int n; } void -md_swapout_jmpslot(j, n) -jmpslot_t *j; -int n; +md_swapout_jmpslot(jmpslot_t *j, int n) { for (; n; n--, j++) { j->opcode = md_swap_short(j->opcode); diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c index 3e98548a576..6542a9d68ef 100644 --- a/gnu/usr.bin/ld/warnings.c +++ b/gnu/usr.bin/ld/warnings.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: warnings.c,v 1.7 2002/07/17 20:33:29 marc Exp $*/ +/* * $OpenBSD: warnings.c,v 1.8 2002/07/19 19:28:12 marc Exp $*/ /* */ @@ -33,9 +33,7 @@ static int reported_undefineds; */ void -prline_file_name (entry, outfile) - struct file_entry *entry; - FILE *outfile; +prline_file_name(struct file_entry *entry, FILE *outfile) { print_file_name (entry, outfile); fprintf (outfile, "\n"); @@ -46,9 +44,7 @@ prline_file_name (entry, outfile) */ void -print_file_name (entry, outfile) - struct file_entry *entry; - FILE *outfile; +print_file_name(struct file_entry *entry, FILE *outfile) { if (entry == NULL) { fprintf (outfile, "NULL"); @@ -66,8 +62,7 @@ print_file_name (entry, outfile) */ char * -get_file_name (entry) - struct file_entry *entry; +get_file_name(struct file_entry *entry) { char *result, *supfile; @@ -95,8 +90,7 @@ static void describe_file_sections(struct file_entry *, FILE *); static void list_file_locals(struct file_entry *, FILE *); void -print_symbols(outfile) - FILE *outfile; +print_symbols(FILE *outfile) { fprintf(outfile, "\nFiles:\n\n"); each_file(describe_file_sections, (void *)outfile); @@ -124,9 +118,7 @@ print_symbols(outfile) } static void -describe_file_sections(entry, outfile) - struct file_entry *entry; - FILE *outfile; +describe_file_sections(struct file_entry *entry, FILE *outfile) { fprintf(outfile, " "); print_file_name(entry, outfile); @@ -140,9 +132,7 @@ describe_file_sections(entry, outfile) } static void -list_file_locals (entry, outfile) - struct file_entry *entry; - FILE *outfile; +list_file_locals(struct file_entry *entry, FILE *outfile) { struct localsymbol *lsp, *lspend; @@ -198,8 +188,7 @@ struct line_debug_entry */ static int -reloc_cmp(rel1, rel2) - struct relocation_info *rel1, *rel2; +reloc_cmp(struct relocation_info *rel1, struct relocation_info *rel2) { return RELOC_ADDRESS(rel1) - RELOC_ADDRESS(rel2); } @@ -214,10 +203,7 @@ reloc_cmp(rel1, rel2) */ static int -next_debug_entry(use_data_symbols, state_pointer) - int use_data_symbols; - /* Next must be passed by reference! */ - struct line_debug_entry state_pointer[3]; +next_debug_entry(int use_data_symbols, struct line_debug_entry state_pointer[3]) { struct line_debug_entry *current = state_pointer, *next = state_pointer + 1, @@ -279,9 +265,7 @@ next_debug_entry(use_data_symbols, state_pointer) */ static struct line_debug_entry * -init_debug_scan(use_data_symbols, entry) - int use_data_symbols; - struct file_entry *entry; +init_debug_scan(int use_data_symbols, struct file_entry *entry) { struct localsymbol *lsp, *lspend; struct line_debug_entry *state_pointer, *current, *next, *source; @@ -340,10 +324,7 @@ init_debug_scan(use_data_symbols, entry) */ static int -address_to_line(address, state_pointer) - unsigned long address; -/* Next must be passed by reference! */ - struct line_debug_entry state_pointer[3]; +address_to_line(unsigned long address, struct line_debug_entry state_pointer[3]) { struct line_debug_entry *current, *next, *tmp_pointer; int use_data_symbols; @@ -396,11 +377,8 @@ address_to_line(address, state_pointer) */ static void -do_relocation_warnings(entry, data_segment, outfile, nlist_bitvector) - struct file_entry *entry; - int data_segment; - FILE *outfile; - unsigned char *nlist_bitvector; +do_relocation_warnings(struct file_entry *entry, int data_segment, + FILE *outfile, unsigned char *nlist_bitvector) { struct relocation_info *rp, *erp; int start_of_segment; @@ -535,9 +513,7 @@ do_relocation_warnings(entry, data_segment, outfile, nlist_bitvector) */ void -do_file_warnings (entry, outfile) - struct file_entry *entry; - FILE *outfile; +do_file_warnings(struct file_entry *entry, FILE *outfile) { int nsym; int i; @@ -728,8 +704,7 @@ do_file_warnings (entry, outfile) } int -do_warnings(outfile) - FILE *outfile; +do_warnings(FILE *outfile) { list_unresolved_refs = !relocatable_output && diff --git a/gnu/usr.bin/ld/xbits.c b/gnu/usr.bin/ld/xbits.c index 0d7e911738b..0602ab2a876 100644 --- a/gnu/usr.bin/ld/xbits.c +++ b/gnu/usr.bin/ld/xbits.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: xbits.c,v 1.3 2002/07/15 21:05:56 marc Exp $*/ +/* * $OpenBSD: xbits.c,v 1.4 2002/07/19 19:28:12 marc Exp $*/ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -50,18 +50,14 @@ #include "ld.h" void -swap_longs(lp, n) -int n; -long *lp; +swap_longs(long *lp, int n) { for (; n > 0; n--, lp++) *lp = md_swap_long(*lp); } void -swap_symbols(s, n) -struct nlist *s; -int n; +swap_symbols(struct nlist *s, int n) { for (; n; n--, s++) { s->n_un.n_strx = md_swap_long(s->n_un.n_strx); @@ -71,9 +67,7 @@ int n; } void -swap_zsymbols(s, n) -struct nzlist *s; -int n; +swap_zsymbols(struct nzlist *s, int n) { for (; n; n--, s++) { s->nz_strx = md_swap_long(s->nz_strx); @@ -85,9 +79,7 @@ int n; void -swap_ranlib_hdr(rlp, n) -struct ranlib *rlp; -int n; +swap_ranlib_hdr(struct ranlib *rlp, int n) { for (; n; n--, rlp++) { rlp->ran_un.ran_strx = md_swap_long(rlp->ran_un.ran_strx); @@ -96,8 +88,7 @@ int n; } void -swap__dynamic(dp) -struct _dynamic *dp; +swap__dynamic(struct _dynamic *dp) { dp->d_version = md_swap_long(dp->d_version); dp->d_debug = (struct so_debug *)md_swap_long((long)dp->d_debug); @@ -107,23 +98,19 @@ struct _dynamic *dp; } void -swap_section_dispatch_table(sdp) -struct section_dispatch_table *sdp; +swap_section_dispatch_table(struct section_dispatch_table *sdp) { swap_longs((long *)sdp, sizeof(*sdp)/sizeof(long)); } void -swap_so_debug(ddp) -struct so_debug *ddp; +swap_so_debug(struct so_debug *ddp) { swap_longs((long *)ddp, sizeof(*ddp)/sizeof(long)); } void -swapin_sod(sodp, n) -struct sod *sodp; -int n; +swapin_sod(struct sod *sodp, int n) { unsigned long bits; @@ -138,9 +125,7 @@ int n; } void -swapout_sod(sodp, n) -struct sod *sodp; -int n; +swapout_sod(struct sod *sodp, int n) { unsigned long bits; @@ -155,9 +140,7 @@ int n; } void -swap_rrs_hash(fsp, n) -struct rrs_hash *fsp; -int n; +swap_rrs_hash(struct rrs_hash *fsp, int n) { for (; n; n--, fsp++) { fsp->rh_symbolnum = md_swap_long(fsp->rh_symbolnum); |