diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-07-11 19:49:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-07-11 19:49:48 +0000 |
commit | 4126d3ea95f48508addd8cb4d2739b8f77307f7a (patch) | |
tree | f53883e0e162453d9f5cb65fba1a61363ec3308a | |
parent | b452a91aed9179442537f304cd1d31c5ed81b9aa (diff) | |
download | gdb-4126d3ea95f48508addd8cb4d2739b8f77307f7a.tar.gz |
* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
as appropriate. Fill in structure initializations. Add variable
initializations. Add casts.
* dwarf1.c (parse_line_table): Change eachLine to unsigned long.
(dwarf1_unit_find_nearest_line): Change i to unsigned long.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/aout-target.h | 6 | ||||
-rw-r--r-- | bfd/aoutx.h | 67 | ||||
-rw-r--r-- | bfd/archive.c | 2 | ||||
-rw-r--r-- | bfd/bfd.c | 4 | ||||
-rw-r--r-- | bfd/binary.c | 12 | ||||
-rw-r--r-- | bfd/coffgen.c | 12 | ||||
-rw-r--r-- | bfd/dwarf1.c | 8 | ||||
-rw-r--r-- | bfd/dwarf2.c | 22 | ||||
-rw-r--r-- | bfd/elf.c | 38 | ||||
-rw-r--r-- | bfd/elf32-gen.c | 10 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 40 | ||||
-rw-r--r-- | bfd/elflink.c | 4 | ||||
-rw-r--r-- | bfd/elflink.h | 10 | ||||
-rw-r--r-- | bfd/hash.c | 4 | ||||
-rw-r--r-- | bfd/i386linux.c | 5 | ||||
-rw-r--r-- | bfd/ihex.c | 6 | ||||
-rw-r--r-- | bfd/libbfd.c | 54 | ||||
-rw-r--r-- | bfd/linker.c | 13 | ||||
-rw-r--r-- | bfd/reloc.c | 12 | ||||
-rw-r--r-- | bfd/section.c | 16 | ||||
-rw-r--r-- | bfd/srec.c | 8 | ||||
-rw-r--r-- | bfd/stabs.c | 6 | ||||
-rw-r--r-- | bfd/syms.c | 46 | ||||
-rw-r--r-- | bfd/tekhex.c | 13 | ||||
-rw-r--r-- | bfd/trad-core.c | 21 |
26 files changed, 236 insertions, 209 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f9421e59197..c3b0f7bab74 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 1999-07-11 Ian Lance Taylor <ian@zembu.com> + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Fill in structure initializations. Add variable + initializations. Add casts. + * dwarf1.c (parse_line_table): Change eachLine to unsigned long. + (dwarf1_unit_find_nearest_line): Change i to unsigned long. + * elf.c (bfd_elf_hash): Change parameter from unsigned char * to char *. * elf-bfd.h (bfd_elf_hash): Update declaration. diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 1aee07aada0..876b30a95a3 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -1,5 +1,5 @@ /* Define a target vector and some small routines for a variant of a.out. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -234,9 +234,9 @@ static boolean MY_bfd_copy_private_section_data static boolean MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; - asection *isec; + asection *isec ATTRIBUTE_UNUSED; bfd *obfd; - asection *osec; + asection *osec ATTRIBUTE_UNUSED; { if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour && bfd_get_flavour (obfd) == bfd_target_aout_flavour) diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 2704eecccfe..66b414f098b 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1,5 +1,5 @@ /* BFD semi-generic back-end for a.out binaries. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -228,28 +228,35 @@ HOWTO( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", tr HOWTO( 8, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"GOT_REL", false, 0,0x00000000, false), HOWTO( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false), HOWTO(10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false), -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, HOWTO(16, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false, 0,0x00000000, false), -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, HOWTO(32, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false), -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, -{ -1 }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, +{ -1, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, HOWTO(40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false), }; @@ -1072,7 +1079,7 @@ boolean NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) bfd *abfd; bfd_size_type *text_size; - file_ptr *text_end; + file_ptr *text_end ATTRIBUTE_UNUSED; { struct internal_exec *execp = exec_hdr (abfd); @@ -2531,16 +2538,16 @@ NAME(aout,get_symtab_upper_bound) (abfd) /*ARGSUSED*/ alent * NAME(aout,get_lineno) (ignore_abfd, ignore_symbol) - bfd *ignore_abfd; - asymbol *ignore_symbol; + bfd *ignore_abfd ATTRIBUTE_UNUSED; + asymbol *ignore_symbol ATTRIBUTE_UNUSED; { -return (alent *)NULL; + return (alent *)NULL; } /*ARGSUSED*/ void NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; symbol_info *ret; { @@ -2568,7 +2575,7 @@ NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret) /*ARGSUSED*/ void NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -2878,7 +2885,7 @@ NAME(aout,find_nearest_line) int NAME(aout,sizeof_headers) (abfd, execable) bfd *abfd; - boolean execable; + boolean execable ATTRIBUTE_UNUSED; { return adata(abfd).exec_bytes_size; } @@ -4719,6 +4726,8 @@ aout_reloc_index_to_section (abfd, indx) default: abort (); } + /*NOTREACHED*/ + return NULL; } /* Relocate an a.out section using standard a.out relocs. */ @@ -5493,7 +5502,7 @@ aout_link_reloc_link_order (finfo, o, p) int r_index; int r_extern; reloc_howto_type *howto; - file_ptr *reloff_ptr; + file_ptr *reloff_ptr = NULL; struct reloc_std_external srel; struct reloc_ext_external erel; PTR rel_ptr; diff --git a/bfd/archive.c b/bfd/archive.c index ac5aeaf6220..19293af4573 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -1178,7 +1178,7 @@ normalize (abfd, file) #else static const char * normalize (abfd, file) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; const char *file; { const char *filename = strrchr (file, '/'); diff --git a/bfd/bfd.c b/bfd/bfd.c index 597e8f0bc68..c6809d7986d 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1,5 +1,5 @@ /* Generic BFD library interface and support routines. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -618,7 +618,7 @@ DESCRIPTION /*ARGSUSED*/ void bfd_set_reloc (ignore_abfd, asect, location, count) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; sec_ptr asect; arelent **location; unsigned int count; diff --git a/bfd/binary.c b/bfd/binary.c index 6c63fff4adf..b5b2fad3fbc 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -58,7 +58,7 @@ static int binary_sizeof_headers PARAMS ((bfd *, boolean)); static boolean binary_mkobject (abfd) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; { return true; } @@ -112,7 +112,7 @@ binary_object_p (abfd) static boolean binary_get_section_contents (abfd, section, location, offset, count) bfd *abfd; - asection *section; + asection *section ATTRIBUTE_UNUSED; PTR location; file_ptr offset; bfd_size_type count; @@ -127,7 +127,7 @@ binary_get_section_contents (abfd, section, location, offset, count) static long binary_get_symtab_upper_bound (abfd) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; { return (BIN_SYMS + 1) * sizeof (asymbol *); } @@ -222,7 +222,7 @@ binary_make_empty_symbol (abfd) static void binary_get_symbol_info (ignore_abfd, symbol, ret) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; symbol_info *ret; { @@ -318,8 +318,8 @@ binary_set_section_contents (abfd, sec, data, offset, size) static int binary_sizeof_headers (abfd, exec) - bfd *abfd; - boolean exec; + bfd *abfd ATTRIBUTE_UNUSED; + boolean exec ATTRIBUTE_UNUSED; { return 0; } diff --git a/bfd/coffgen.c b/bfd/coffgen.c index a06ed663b3d..8495f3d7cef 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1,5 +1,5 @@ /* Support for the generic parts of COFF, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -559,7 +559,7 @@ coff_count_linenumbers (abfd) /*ARGSUSED*/ coff_symbol_type * coff_symbol_from (ignore_abfd, symbol) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; { if (bfd_asymbol_flavour (symbol) != bfd_target_coff_flavour) @@ -1351,7 +1351,7 @@ coff_write_linenumbers (abfd) /*ARGSUSED */ alent * coff_get_lineno (ignore_abfd, symbol) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; { return coffsymbol (symbol)->lineno; @@ -1857,8 +1857,8 @@ coff_make_empty_symbol (abfd) asymbol * coff_bfd_make_debug_symbol (abfd, ptr, sz) bfd *abfd; - PTR ptr; - unsigned long sz; + PTR ptr ATTRIBUTE_UNUSED; + unsigned long sz ATTRIBUTE_UNUSED; { coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type)); if (new == NULL) @@ -2105,7 +2105,7 @@ coff_print_symbol (abfd, filep, symbol, how) boolean _bfd_coff_is_local_label_name (abfd, name) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; const char *name; { return name[0] == '.' && name[1] == 'L'; diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c index d87df92c10f..903bfc38ab5 100644 --- a/bfd/dwarf1.c +++ b/bfd/dwarf1.c @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998 Free Software Foundation, Inc. + Copyright 1998, 1999 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -291,7 +291,7 @@ parse_line_table (stash, aUnit) xptr = stash->line_section + aUnit->stmt_list_offset; if (xptr < stash->line_section_end) { - int eachLine; + unsigned long eachLine; char* tblend; unsigned long base; @@ -398,7 +398,7 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, { if (aUnit->has_stmt_list) { - int i; + unsigned long i; struct dwarf1_func* eachFunc; if (! aUnit->linenumber_table) @@ -454,7 +454,7 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, linenumber_ptr) bfd *abfd; asection *section; - asymbol **symbols; + asymbol **symbols ATTRIBUTE_UNUSED; bfd_vma offset; const char **filename_ptr; const char **functionname_ptr; diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 16986ad38ea..143c3fa1d8c 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -1,5 +1,5 @@ /* DWARF 2 support. - Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -170,7 +170,7 @@ struct comp_unit { static unsigned int read_1_byte (abfd, buf) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; char *buf; { return bfd_get_8 (abfd, (bfd_byte *) buf); @@ -178,7 +178,7 @@ read_1_byte (abfd, buf) static int read_1_signed_byte (abfd, buf) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; char *buf; { return bfd_get_signed_8 (abfd, (bfd_byte *) buf); @@ -238,9 +238,9 @@ read_8_bytes (abfd, buf) static char * read_n_bytes (abfd, buf, size) - bfd * abfd; + bfd *abfd ATTRIBUTE_UNUSED; char *buf; - unsigned int size; + unsigned int size ATTRIBUTE_UNUSED; { /* If the size of a host char is 8 bits, we can return a pointer to the buffer, otherwise we have to copy the data to a buffer @@ -250,7 +250,7 @@ read_n_bytes (abfd, buf, size) static char * read_string (abfd, buf, bytes_read_ptr) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; char *buf; unsigned int *bytes_read_ptr; { @@ -268,7 +268,7 @@ read_string (abfd, buf, bytes_read_ptr) static unsigned int read_unsigned_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; char *buf; unsigned int *bytes_read_ptr; { @@ -298,8 +298,8 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) static int read_signed_leb128 (abfd, buf, bytes_read_ptr) - bfd * abfd; - char * buf; + bfd *abfd ATTRIBUTE_UNUSED; + char *buf; unsigned int * bytes_read_ptr; { int result; @@ -1236,7 +1236,7 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) struct comp_unit* unit; unsigned short version; - unsigned int abbrev_offset; + unsigned int abbrev_offset = 0; unsigned char addr_size; struct abbrev_info** abbrevs; @@ -1457,7 +1457,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, addr_size) bfd *abfd; asection *section; - asymbol **symbols; + asymbol **symbols ATTRIBUTE_UNUSED; bfd_vma offset; const char **filename_ptr; const char **functionname_ptr; diff --git a/bfd/elf.c b/bfd/elf.c index 65bba6124aa..025fb8e05e0 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -505,13 +505,13 @@ bfd_elf_generic_reloc (abfd, input_section, output_bfd, error_message) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry; asymbol *symbol; - PTR data; + PTR data ATTRIBUTE_UNUSED; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 @@ -946,7 +946,7 @@ bfd_elf_set_dt_needed_name (abfd, name) struct bfd_link_needed_list * bfd_elf_get_needed_list (abfd, info) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { if (info->hash->creator->flavour != bfd_target_elf_flavour) @@ -4193,7 +4193,7 @@ _bfd_elf_get_dynamic_symtab_upper_bound (abfd) long _bfd_elf_get_reloc_upper_bound (abfd, asect) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; sec_ptr asect; { return (asect->reloc_count + 1) * sizeof (arelent *); @@ -4524,7 +4524,7 @@ _bfd_elf_make_empty_symbol (abfd) void _bfd_elf_get_symbol_info (ignore_abfd, symbol, ret) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; symbol_info *ret; { @@ -4537,7 +4537,7 @@ _bfd_elf_get_symbol_info (ignore_abfd, symbol, ret) boolean _bfd_elf_is_local_label_name (abfd, name) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; const char *name; { /* Normal local symbols start with ``.L''. */ @@ -4563,8 +4563,8 @@ _bfd_elf_is_local_label_name (abfd, name) alent * _bfd_elf_get_lineno (ignore_abfd, symbol) - bfd *ignore_abfd; - asymbol *symbol; + bfd *ignore_abfd ATTRIBUTE_UNUSED; + asymbol *symbol ATTRIBUTE_UNUSED; { abort (); return NULL; @@ -4714,9 +4714,9 @@ _bfd_elf_set_section_contents (abfd, section, location, offset, count) void _bfd_elf_no_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf_Internal_Rela *dst; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr ATTRIBUTE_UNUSED; + Elf_Internal_Rela *dst ATTRIBUTE_UNUSED; { abort (); } @@ -4850,13 +4850,13 @@ _bfd_elf_close_and_cleanup (abfd) bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg) - bfd *abfd; - arelent *re; - struct symbol_cache_entry *symbol; - PTR data; - asection *is; - bfd *obfd; - char **errmsg; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *re ATTRIBUTE_UNUSED; + struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *is ATTRIBUTE_UNUSED; + bfd *obfd ATTRIBUTE_UNUSED; + char **errmsg ATTRIBUTE_UNUSED; { return bfd_reloc_ok; } diff --git a/bfd/elf32-gen.c b/bfd/elf32-gen.c index 7ed35ae3895..47da53b1bc6 100644 --- a/bfd/elf32-gen.c +++ b/bfd/elf32-gen.c @@ -1,5 +1,5 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -42,18 +42,18 @@ static reloc_howto_type dummy = static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf32_Internal_Rela *elf_reloc; + Elf32_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } static void elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf32_Internal_Rel *elf_reloc; + Elf32_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index a8496b128cb..ed3101d3c5d 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -67,15 +67,15 @@ static reloc_howto_type elf_howto_table[]= HOWTO(R_386_RELATIVE, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_RELATIVE", true,0xffffffff,0xffffffff,false), HOWTO(R_386_GOTOFF, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTOFF", true,0xffffffff,0xffffffff,false), HOWTO(R_386_GOTPC, 0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTPC", true,0xffffffff,0xffffffff,true), - { 11 }, - { 12 }, - { 13 }, - { 14 }, - { 15 }, - { 16 }, - { 17 }, - { 18 }, - { 19 }, + { 11, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 12, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 13, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 14, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 15, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 16, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 17, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 18, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, + { 19, 0, 0, 0, false, 0, complain_overflow_dont, NULL, NULL, false, 0, 0, false }, /* The remaining relocs are a GNU extension. */ HOWTO(R_386_16, 0,1,16,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_16", true,0xffff,0xffff,false), HOWTO(R_386_PC16, 0,1,16,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC16", true,0xffff,0xffff,true), @@ -123,7 +123,7 @@ static reloc_howto_type elf32_i386_vtentry_howto = static reloc_howto_type * elf_i386_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { switch (code) @@ -211,16 +211,16 @@ elf_i386_reloc_type_lookup (abfd, code) static void elf_i386_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf32_Internal_Rela *dst; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr ATTRIBUTE_UNUSED; + Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED; { abort (); } static void elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf32_Internal_Rel *dst; { @@ -714,7 +714,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) static asection * elf_i386_gc_mark_hook (abfd, info, rel, h, sym) bfd *abfd; - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; @@ -760,10 +760,10 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) static boolean elf_i386_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; { /* ??? It would seem that the existing i386 code does no sort of reference counting or whatnot on its GOT and PLT entries, @@ -1139,7 +1139,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) static boolean elf_i386_discard_copies (h, ignore) struct elf_i386_link_hash_entry *h; - PTR ignore; + PTR ignore ATTRIBUTE_UNUSED; { struct elf_i386_pcrel_relocs_copied *s; diff --git a/bfd/elflink.c b/bfd/elflink.c index d644e1b4c2c..e26dedd6ce4 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1,5 +1,5 @@ /* ELF linking support for BFD. - Copyright 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -100,7 +100,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) flagword flags, pltflags; register asection *s; struct elf_backend_data *bed = get_elf_backend_data (abfd); - int ptralign; + int ptralign = 0; switch (bed->s->arch_size) { diff --git a/bfd/elflink.h b/bfd/elflink.h index fc07d7d8eae..26fee850aa9 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2237,7 +2237,7 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, /*ARGSUSED*/ boolean NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; const char *name; boolean provide; @@ -2356,7 +2356,7 @@ compute_bucket_count (info) struct bfd_link_info *info; { size_t dynsymcount = elf_hash_table (info)->dynsymcount; - size_t best_size; + size_t best_size = 0; unsigned long int *hashcodes; unsigned long int *hashcodesp; unsigned long int i; @@ -4849,7 +4849,7 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, Elf_Internal_Rela *irelaend; Elf_Internal_Shdr *output_rel_hdr; asection *output_section; - unsigned int *rel_countp; + unsigned int *rel_countp = NULL; output_section = input_section->output_section; output_rel_hdr = NULL; @@ -6183,8 +6183,8 @@ win: boolean elf_gc_record_vtentry (abfd, sec, h, addend) - bfd *abfd; - asection *sec; + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; struct elf_link_hash_entry *h; bfd_vma addend; { diff --git a/bfd/hash.c b/bfd/hash.c index 097304037df..173eaf76eef 100644 --- a/bfd/hash.c +++ b/bfd/hash.c @@ -1,5 +1,5 @@ /* hash.c -- hash table routines for BFD - Copyright (C) 1993, 94, 95, 1997 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 97, 1999 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> This file is part of BFD, the Binary File Descriptor library. @@ -450,7 +450,7 @@ struct bfd_hash_entry * bfd_hash_newfunc (entry, table, string) struct bfd_hash_entry *entry; struct bfd_hash_table *table; - const char *string; + const char *string ATTRIBUTE_UNUSED; { if (entry == (struct bfd_hash_entry *) NULL) entry = ((struct bfd_hash_entry *) diff --git a/bfd/i386linux.c b/bfd/i386linux.c index 804bdcd1c1a..5df2a11c50f 100644 --- a/bfd/i386linux.c +++ b/bfd/i386linux.c @@ -1,5 +1,6 @@ /* BFD back-end for linux flavored i386 a.out binaries. - Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -297,7 +298,7 @@ new_fixup (info, h, value, builtin) static boolean linux_link_create_dynamic_sections (abfd, info) bfd *abfd; - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; { flagword flags; register asection *s; diff --git a/bfd/ihex.c b/bfd/ihex.c index b9953d329f5..5eb3862b448 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel Hex objects. - Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>. This file is part of BFD, the Binary File Descriptor library. @@ -947,8 +947,8 @@ ihex_set_arch_mach (abfd, arch, mach) /*ARGSUSED*/ static int ihex_sizeof_headers (abfd, exec) - bfd *abfd; - boolean exec; + bfd *abfd ATTRIBUTE_UNUSED; + boolean exec ATTRIBUTE_UNUSED; { return 0; } diff --git a/bfd/libbfd.c b/bfd/libbfd.c index d2fee39edeb..d2baa5b3a2c 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1,5 +1,5 @@ /* Assorted BFD support routines, only used internally. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -45,7 +45,7 @@ DESCRIPTION /*ARGSUSED*/ boolean bfd_false (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_invalid_operation); return false; @@ -57,7 +57,7 @@ bfd_false (ignore) /*ARGSUSED*/ boolean bfd_true (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { return true; } @@ -68,7 +68,7 @@ bfd_true (ignore) /*ARGSUSED*/ PTR bfd_nullvoidptr (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_invalid_operation); return NULL; @@ -77,7 +77,7 @@ bfd_nullvoidptr (ignore) /*ARGSUSED*/ int bfd_0 (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { return 0; } @@ -85,7 +85,7 @@ bfd_0 (ignore) /*ARGSUSED*/ unsigned int bfd_0u (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { return 0; } @@ -93,7 +93,7 @@ bfd_0u (ignore) /*ARGUSED*/ long bfd_0l (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { return 0; } @@ -104,7 +104,7 @@ bfd_0l (ignore) /*ARGSUSED*/ long _bfd_n1 (ignore_abfd) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_invalid_operation); return -1; @@ -113,15 +113,15 @@ _bfd_n1 (ignore_abfd) /*ARGSUSED*/ void bfd_void (ignore) - bfd *ignore; + bfd *ignore ATTRIBUTE_UNUSED; { } /*ARGSUSED*/ boolean _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) - bfd *ignore_core_bfd; - bfd *ignore_exec_bfd; + bfd *ignore_core_bfd ATTRIBUTE_UNUSED; + bfd *ignore_exec_bfd ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_invalid_operation); return false; @@ -133,7 +133,7 @@ _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) /*ARGSUSED*/ char * _bfd_nocore_core_file_failing_command (ignore_abfd) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_invalid_operation); return (char *)NULL; @@ -145,7 +145,7 @@ _bfd_nocore_core_file_failing_command (ignore_abfd) /*ARGSUSED*/ int _bfd_nocore_core_file_failing_signal (ignore_abfd) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_invalid_operation); return 0; @@ -154,7 +154,7 @@ _bfd_nocore_core_file_failing_signal (ignore_abfd) /*ARGSUSED*/ const bfd_target * _bfd_dummy_target (ignore_abfd) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; { bfd_set_error (bfd_error_wrong_format); return 0; @@ -1003,7 +1003,7 @@ bfd_getl_signed_32 (addr) bfd_vma bfd_getb64 (addr) - register const bfd_byte *addr; + register const bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 bfd_vma low, high; @@ -1027,7 +1027,7 @@ bfd_getb64 (addr) bfd_vma bfd_getl64 (addr) - register const bfd_byte *addr; + register const bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 bfd_vma low, high; @@ -1051,7 +1051,7 @@ bfd_getl64 (addr) bfd_signed_vma bfd_getb_signed_64 (addr) - register const bfd_byte *addr; + register const bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 bfd_vma low, high; @@ -1075,7 +1075,7 @@ bfd_getb_signed_64 (addr) bfd_signed_vma bfd_getl_signed_64 (addr) - register const bfd_byte *addr; + register const bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 bfd_vma low, high; @@ -1120,8 +1120,8 @@ bfd_putl32 (data, addr) void bfd_putb64 (data, addr) - bfd_vma data; - register bfd_byte *addr; + bfd_vma data ATTRIBUTE_UNUSED; + register bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 addr[0] = (bfd_byte)(data >> (7*8)); @@ -1139,8 +1139,8 @@ bfd_putb64 (data, addr) void bfd_putl64 (data, addr) - bfd_vma data; - register bfd_byte *addr; + bfd_vma data ATTRIBUTE_UNUSED; + register bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 addr[7] = (bfd_byte)(data >> (7*8)); @@ -1177,11 +1177,11 @@ _bfd_generic_get_section_contents (abfd, section, location, offset, count) boolean _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) - bfd *abfd; - sec_ptr section; - bfd_window *w; - file_ptr offset; - bfd_size_type count; + bfd *abfd ATTRIBUTE_UNUSED; + sec_ptr section ATTRIBUTE_UNUSED; + bfd_window *w ATTRIBUTE_UNUSED; + file_ptr offset ATTRIBUTE_UNUSED; + bfd_size_type count ATTRIBUTE_UNUSED; { #ifdef USE_MMAP if (count == 0) diff --git a/bfd/linker.c b/bfd/linker.c index b1fb6211f83..edf96fe7efd 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1,5 +1,6 @@ /* linker.c -- BFD linker routines - Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support This file is part of BFD, the Binary File Descriptor library. @@ -1748,8 +1749,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, case MDEF: /* Handle a multiple definition. */ { - asection *msec; - bfd_vma mval; + asection *msec = NULL; + bfd_vma mval = 0; switch (h->type) { @@ -2602,7 +2603,7 @@ _bfd_default_link_order (abfd, info, sec, link_order) static boolean default_fill_link_order (abfd, info, sec, link_order) bfd *abfd; - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; asection *sec; struct bfd_link_order *link_order; { @@ -2797,8 +2798,8 @@ DESCRIPTION boolean _bfd_generic_link_split_section (abfd, sec) - bfd *abfd; - asection *sec; + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; { return false; } diff --git a/bfd/reloc.c b/bfd/reloc.c index 5e1b73a0ba7..320d49075d4 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -1405,7 +1405,7 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location) bfd_byte *location; { int size; - bfd_vma x; + bfd_vma x = 0; boolean overflow; unsigned int rightshift = howto->rightshift; unsigned int bitpos = howto->bitpos; @@ -2701,9 +2701,9 @@ DESCRIPTION /*ARGSUSED*/ boolean bfd_generic_relax_section (abfd, section, link_info, again) - bfd *abfd; - asection *section; - struct bfd_link_info *link_info; + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; boolean *again; { *again = false; @@ -2726,8 +2726,8 @@ DESCRIPTION /*ARGSUSED*/ boolean bfd_generic_gc_sections (abfd, link_info) - bfd *abfd; - struct bfd_link_info *link_info; + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; { return true; } diff --git a/bfd/section.c b/bfd/section.c index 414a9cd912c..3e0aa2b2079 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -1,5 +1,5 @@ /* Object file "section" support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -486,10 +486,14 @@ CODE_FRAGMENT static const asymbol global_syms[] = { /* the_bfd, name, value, attr, section [, udata] */ - {0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_com_section}, - {0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_und_section}, - {0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_abs_section}, - {0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_ind_section}, + {0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM, + (asection *) &bfd_com_section, { 0 }}, + {0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM, + (asection *) &bfd_und_section, { 0 }}, + {0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM, + (asection *) &bfd_abs_section, { 0 }}, + {0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM, + (asection *) &bfd_ind_section, { 0 }}, }; #define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ @@ -737,7 +741,7 @@ DESCRIPTION /*ARGSUSED*/ boolean bfd_set_section_flags (abfd, section, flags) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; sec_ptr section; flagword flags; { diff --git a/bfd/srec.c b/bfd/srec.c index 70d2f96175e..e77ba407a51 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1139,8 +1139,8 @@ symbolsrec_write_object_contents (abfd) /*ARGSUSED*/ static int srec_sizeof_headers (abfd, exec) - bfd *abfd; - boolean exec; + bfd *abfd ATTRIBUTE_UNUSED; + boolean exec ATTRIBUTE_UNUSED; { return 0; } @@ -1209,7 +1209,7 @@ srec_get_symtab (abfd, alocation) /*ARGSUSED*/ static void srec_get_symbol_info (ignore_abfd, symbol, ret) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; symbol_info *ret; { @@ -1219,7 +1219,7 @@ srec_get_symbol_info (ignore_abfd, symbol, ret) /*ARGSUSED*/ static void srec_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; PTR afile; asymbol *symbol; bfd_print_symbol_type how; diff --git a/bfd/stabs.c b/bfd/stabs.c index ffc000d499e..ea4da8fccc9 100644 --- a/bfd/stabs.c +++ b/bfd/stabs.c @@ -1,5 +1,5 @@ /* Stabs in sections linking support. - Copyright 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -619,8 +619,8 @@ _bfd_write_stab_strings (output_bfd, psinfo) bfd_vma _bfd_stab_section_offset (output_bfd, psinfo, stabsec, psecinfo, offset) - bfd *output_bfd; - PTR *psinfo; + bfd *output_bfd ATTRIBUTE_UNUSED; + PTR *psinfo ATTRIBUTE_UNUSED; asection *stabsec; PTR *psecinfo; bfd_vma offset; diff --git a/bfd/syms.c b/bfd/syms.c index f69d1f21fa4..108e3eac27b 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -1,5 +1,5 @@ /* Generic symbol-table support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -698,10 +698,10 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) /*ARGSUSED*/ asymbol * _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym) - bfd *abfd; - boolean dynamic; + bfd *abfd ATTRIBUTE_UNUSED; + boolean dynamic ATTRIBUTE_UNUSED; const PTR minisym; - asymbol *sym; + asymbol *sym ATTRIBUTE_UNUSED; { return *(asymbol **) minisym; } @@ -796,7 +796,8 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, { struct stab_find_info *info; bfd_size_type stabsize, strsize; - bfd_byte *stab, *str, *last_stab; + bfd_byte *stab, *str; + bfd_byte *last_stab = NULL; bfd_size_type stroff; struct indexentry *indexentry; char *directory_name, *file_name; @@ -1032,23 +1033,24 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, file_name = NULL; saw_fun = 1; } - else { - last_stab = stab; - if (stab + STABSIZE >= info->stabs + stabsize - || *(stab + STABSIZE + TYPEOFF) != N_SO) - { - directory_name = NULL; - } - else - { - /* Two consecutive N_SOs are a directory and a file - name. */ - stab += STABSIZE; - directory_name = file_name; - file_name = ((char *) str - + bfd_get_32 (abfd, stab + STRDXOFF)); - } - } + else + { + last_stab = stab; + if (stab + STABSIZE >= info->stabs + stabsize + || *(stab + STABSIZE + TYPEOFF) != N_SO) + { + directory_name = NULL; + } + else + { + /* Two consecutive N_SOs are a directory and a + file name. */ + stab += STABSIZE; + directory_name = file_name; + file_name = ((char *) str + + bfd_get_32 (abfd, stab + STRDXOFF)); + } + } break; case N_SOL: diff --git a/bfd/tekhex.c b/bfd/tekhex.c index c88fe2dbaf2..cd1563ffc8a 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -1,5 +1,6 @@ /* BFD backend for Extended Tektronix Hex Format objects. - Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 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 BFD, the Binary File Descriptor library. @@ -599,7 +600,7 @@ move_section_contents (abfd, section, locationp, offset, count, get) bfd *abfd; asection *section; PTR locationp; - file_ptr offset; + file_ptr offset ATTRIBUTE_UNUSED; bfd_size_type count; boolean get; { @@ -928,8 +929,8 @@ tekhex_write_object_contents (abfd) static int tekhex_sizeof_headers (abfd, exec) - bfd *abfd; - boolean exec; + bfd *abfd ATTRIBUTE_UNUSED; + boolean exec ATTRIBUTE_UNUSED; { return 0; @@ -951,7 +952,7 @@ tekhex_make_empty_symbol (abfd) static void tekhex_get_symbol_info (ignore_abfd, symbol, ret) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; symbol_info *ret; { @@ -960,7 +961,7 @@ tekhex_get_symbol_info (ignore_abfd, symbol, ret) static void tekhex_print_symbol (ignore_abfd, filep, symbol, how) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; PTR filep; asymbol *symbol; bfd_print_symbol_type how; diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 21d920b0e87..253eb7ad06f 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -1,5 +1,5 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) - Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 1998 + Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. @@ -105,22 +105,24 @@ trad_unix_core_file_p (abfd) bfd_set_error (bfd_error_system_call); return 0; } - if (NBPG * (UPAGES + u.u_dsize + if ((unsigned long) (NBPG * (UPAGES + u.u_dsize #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE - - u.u_tsize + - u.u_tsize #endif - + u.u_ssize) > statbuf.st_size) + + u.u_ssize)) + > (unsigned long) statbuf.st_size) { bfd_set_error (bfd_error_file_truncated); return 0; } #ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE - if (NBPG * (UPAGES + u.u_dsize + u.u_ssize) + if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + u.u_ssize) #ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED /* Some systems write the file too big. */ - + TRAD_CORE_EXTRA_SIZE_ALLOWED + + TRAD_CORE_EXTRA_SIZE_ALLOWED #endif - < statbuf.st_size) + ) + < (unsigned long) statbuf.st_size) { /* The file is too big. Maybe it's not a core file or we otherwise have bad values for u_dsize and u_ssize). */ @@ -239,7 +241,7 @@ trad_unix_core_file_failing_command (abfd) /* ARGSUSED */ int trad_unix_core_file_failing_signal (ignore_abfd) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; { #ifdef TRAD_UNIX_CORE_FILE_FAILING_SIGNAL return TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(ignore_abfd); @@ -251,7 +253,8 @@ trad_unix_core_file_failing_signal (ignore_abfd) /* ARGSUSED */ boolean trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd, *exec_bfd; + bfd *core_bfd ATTRIBUTE_UNUSED; + bfd *exec_bfd ATTRIBUTE_UNUSED; { return true; /* FIXME, We have no way of telling at this point */ } |