From 87f2a3464bc56880619910126816120eeafdb1e2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 11 Jul 1999 20:09:04 +0000 Subject: [PATCH] * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED as appropriate. Fill in structure initializations. --- ld/ChangeLog | 5 +++++ ld/emultempl/elf32.em | 8 +++++++- ld/ldcref.c | 6 +++--- ld/ldemul.c | 7 ++++--- ld/ldexp.c | 7 ++++--- ld/ldlang.c | 14 +++++++------- ld/ldmain.c | 18 +++++++++--------- 7 files changed, 39 insertions(+), 26 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 55b0e4f054c..ab15633de03 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +1999-07-11 Ian Lance Taylor + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Fill in structure initializations. + 1999-07-10 Ian Lance Taylor * ldfile.c: Revert patch of 1999-07-08. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 41073d25b22..fb4d85a813c 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -7,7 +7,8 @@ cat >e${EMULATION_NAME}.c < ELF support by Ian Lance Taylor @@ -1145,5 +1146,10 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, gld${EMULATION_NAME}_open_dynamic_archive, gld${EMULATION_NAME}_place_orphan + NULL, /* set_symbols */ + NULL, /* parse_args */ + NULL, /* unrecognized_file */ + NULL, /* list_options */ + NULL /* recognized_file */ }; EOF diff --git a/ld/ldcref.c b/ld/ldcref.c index 96e0d2d9df4..c75b8e63fe1 100644 --- a/ld/ldcref.c +++ b/ld/ldcref.c @@ -1,5 +1,5 @@ /* ldcref.c -- output a cross reference table - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor This file is part of GLD, the Gnu Linker. @@ -151,7 +151,7 @@ add_cref (name, abfd, section, value) const char *name; bfd *abfd; asection *section; - bfd_vma value; + bfd_vma value ATTRIBUTE_UNUSED; { struct cref_hash_entry *h; struct cref_ref *r; @@ -354,7 +354,7 @@ check_nocrossrefs () static boolean check_nocrossref (h, ignore) struct cref_hash_entry *h; - PTR ignore; + PTR ignore ATTRIBUTE_UNUSED; { struct bfd_link_hash_entry *hl; asection *defsec; diff --git a/ld/ldemul.c b/ld/ldemul.c index eab0432da3a..85a2894581f 100644 --- a/ld/ldemul.c +++ b/ld/ldemul.c @@ -1,5 +1,6 @@ /* ldemul.c -- clearing house for ld emulation states - Copyright (C) 1991, 92, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -218,7 +219,7 @@ set_output_arch_default() /*ARGSUSED*/ void syslib_default(ignore) - char *ignore; + char *ignore ATTRIBUTE_UNUSED; { info_msg (_("%S SYSLIB ignored\n")); } @@ -226,7 +227,7 @@ syslib_default(ignore) /*ARGSUSED*/ void hll_default(ignore) - char *ignore; + char *ignore ATTRIBUTE_UNUSED; { info_msg (_("%S HLL ignored\n")); } diff --git a/ld/ldexp.c b/ld/ldexp.c index 6c9d726ec19..121ed889d87 100644 --- a/ld/ldexp.c +++ b/ld/ldexp.c @@ -1,6 +1,7 @@ /* This module handles expression trees. -Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. -Written by Steve Chamberlain of Cygnus Support (sac@cygnus.com). + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. + Written by Steve Chamberlain of Cygnus Support (sac@cygnus.com). This file is part of GLD, the Gnu Linker. @@ -967,7 +968,7 @@ exp_get_value_int (tree,def,name, allocation_done) bfd_vma exp_get_abs_int (tree, def, name, allocation_done) etree_type *tree; - int def; + int def ATTRIBUTE_UNUSED; char *name; lang_phase_type allocation_done; { diff --git a/ld/ldlang.c b/ld/ldlang.c index d290391eff6..8e7ae9d4d08 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -155,7 +155,7 @@ static void walk_wild_file /* EXPORTS */ lang_output_section_statement_type *abs_output_section; lang_statement_list_type *stat_ptr = &statement_list; -lang_statement_list_type file_chain = { 0 }; +lang_statement_list_type file_chain = { NULL, NULL }; const char *entry_symbol = NULL; boolean entry_from_cmdline; boolean lang_has_input_file = false; @@ -1430,7 +1430,7 @@ wild (s, section, file, target, output) lang_wild_statement_type *s; const char *section; const char *file; - const char *target; + const char *target ATTRIBUTE_UNUSED; lang_output_section_statement_type *output; { walk_wild (s, section, file, output_section_callback, (void *) output); @@ -2292,7 +2292,7 @@ size_input_section (this_ptr, output_section_statement, fill, dot, relax) lang_output_section_statement_type * output_section_statement; fill_type fill; bfd_vma dot; - boolean relax; + boolean relax ATTRIBUTE_UNUSED; { lang_input_section_type *is = &((*this_ptr)->input_section); asection *i = is->section; @@ -3023,10 +3023,10 @@ lang_finish () static void #ifdef ANSI_PROTOTYPES -ignore_bfd_errors (const char *s, ...) +ignore_bfd_errors (const char *s ATTRIBUTE_UNUSED, ...) #else ignore_bfd_errors (s) - const char *s; + const char *s ATTRIBUTE_UNUSED; #endif { /* Don't do anything. */ @@ -3526,8 +3526,8 @@ static void gc_section_callback (ptr, section, file, data) lang_wild_statement_type *ptr; asection *section; - lang_input_statement_type *file; - void *data; + lang_input_statement_type *file ATTRIBUTE_UNUSED; + void *data ATTRIBUTE_UNUSED; { /* If the wild pattern was marked KEEP, the member sections should be as well. */ diff --git a/ld/ldmain.c b/ld/ldmain.c index 7eef3e53f66..734bc32f05d 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -705,7 +705,7 @@ add_keepsyms_file (filename) /*ARGSUSED*/ static boolean add_archive_element (info, abfd, name) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; bfd *abfd; const char *name; { @@ -820,7 +820,7 @@ add_archive_element (info, abfd, name) /*ARGSUSED*/ static boolean multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *obfd; asection *osec; @@ -857,7 +857,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) /*ARGSUSED*/ static boolean multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *obfd; enum bfd_link_hash_type otype; @@ -924,7 +924,7 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) /*ARGSUSED*/ static boolean add_to_set (info, h, reloc, abfd, section, value) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_hash_entry *h; bfd_reloc_code_real_type reloc; bfd *abfd; @@ -1023,7 +1023,7 @@ struct warning_callback_info /*ARGSUSED*/ static boolean warning_callback (info, warning, symbol, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *warning; const char *symbol; bfd *abfd; @@ -1145,7 +1145,7 @@ warning_find_reloc (abfd, sec, iarg) /*ARGSUSED*/ static boolean undefined_symbol (info, name, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *abfd; asection *section; @@ -1217,7 +1217,7 @@ undefined_symbol (info, name, abfd, section, address) /*ARGSUSED*/ static boolean reloc_overflow (info, name, reloc_name, addend, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; const char *reloc_name; bfd_vma addend; @@ -1241,7 +1241,7 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address) /*ARGSUSED*/ static boolean reloc_dangerous (info, message, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *message; bfd *abfd; asection *section; @@ -1261,7 +1261,7 @@ reloc_dangerous (info, message, abfd, section, address) /*ARGSUSED*/ static boolean unattached_reloc (info, name, abfd, section, address) - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name; bfd *abfd; asection *section; -- 2.30.2