]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix building with --enable-targets=all
authorNick Clifton <nickc@redhat.com>
Wed, 1 Mar 2000 20:39:07 +0000 (20:39 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 1 Mar 2000 20:39:07 +0000 (20:39 +0000)
16 files changed:
bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/coff-arm.c
bfd/coff-mcore.c
bfd/coff-sh.c
bfd/coffcode.h
bfd/elf-m10300.c
bfd/elf32-i370.c
bfd/elf32-m68k.c
bfd/elf32-mcore.c
bfd/elf32-mips.c
bfd/elf32-sh.c
bfd/elflink.h
bfd/pe-mips.c
bfd/peicode.h

index 631c7e8901453d22a13a5dd8d927f8c26898f6d8..640362fd563d76ba556794100084cfacf0dbd01b 100644 (file)
@@ -1,3 +1,58 @@
+2000-02-29  H.J. Lu  <hjl@gnu.org>
+
+       * peicode.h (jtab): Make it static.
+
+       * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is
+       defined and COFF_IMAGE_WITH_PE is not defined.
+       (_bfd_sh_align_load_span): Defined as sh_align_load_span if
+       COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined.
+
+2000-03-01  Nick Clifton  <nickc@cygnus.com>
+
+       * coff-arm.c (bfd_arm_process_before_allocation): Make
+       'symndx' signed to prevent compile time warning.
+
+       * coff-mcore.c: Remove unused prototype for pe_object_p.
+
+       * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static
+       functions that are not used when COFF_IMAGE_WITH_PE is
+       defined.
+       (struct sh_opcode): Change type of 'flags' field to unsigned
+       long so that it can hold the USESAS flag.
+
+       * coffcode.h (styp_to_sec_flags): Initialise 'target_name'.
+
+       * elf-m10300.c (mn10300_elf_relax_section): Initialise
+        'sym_sec'.
+
+       * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function
+       parameters.
+       Remove unusued variables and code.
+       (elf_backend_add_symbol_hook): Fix prototype.
+
+       * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and
+       'srelgot'.
+
+       * elf32-mcore.c (mcore_elf_relocate_section): Initialise
+       'oldinst'. 
+
+       * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function
+       parameters.
+       Remove unusued variables and code.
+       (elf_backend_add_symbol_hook): Fix prototype.
+
+       * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'.
+
+       * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED
+       to unused function parameter.
+       
+       * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function
+       parameters.
+       Use EMPTY_HOWTO to initialise empty howto slots.
+       Remove unused variables.
+
+       * peicode.h (pe_ILF_build_a_bfd): Initialise id6.       
+
 2000-03-01  H.J. Lu  <hjl@gnu.org>
 
        * aoutx.h (aout_link_input_section_std): Pass "true" to
index 15aa3a6558e6afb5ac9756867100296b24ffb281..1f67c0c3a25f45deb3a337b2f3d05b1b4dfaeacc 100644 (file)
@@ -728,6 +728,16 @@ extern boolean bfd_arm_process_before_allocation
 extern boolean bfd_arm_get_bfd_for_interworking
   PARAMS ((bfd *, struct bfd_link_info *));
 
+/* PE ARM Interworking support.  Called from linker.  */
+extern boolean bfd_arm_pe_allocate_interworking_sections
+  PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_arm_pe_process_before_allocation
+  PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_arm_pe_get_bfd_for_interworking
+  PARAMS ((bfd *, struct bfd_link_info *));
+
 /* ELF ARM Interworking support.  Called from linker.  */
 extern boolean bfd_elf32_arm_allocate_interworking_sections
   PARAMS ((struct bfd_link_info *));
index 519ad860358c9fbbaa87cfe706694a55850ad162..5c8338e29df3f2d05327e84641b12e2f17d1727e 100644 (file)
@@ -728,6 +728,16 @@ extern boolean bfd_arm_process_before_allocation
 extern boolean bfd_arm_get_bfd_for_interworking
   PARAMS ((bfd *, struct bfd_link_info *));
 
+/* PE ARM Interworking support.  Called from linker.  */
+extern boolean bfd_arm_pe_allocate_interworking_sections
+  PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_arm_pe_process_before_allocation
+  PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_arm_pe_get_bfd_for_interworking
+  PARAMS ((bfd *, struct bfd_link_info *));
+
 /* ELF ARM Interworking support.  Called from linker.  */
 extern boolean bfd_elf32_arm_allocate_interworking_sections
   PARAMS ((struct bfd_link_info *));
index 5bb7be6f6ac73d68ff32a22528158d539642b3c7..2b89b848c8cd9095fb2bc7920f89126ceb6ed71e 100644 (file)
@@ -2045,7 +2045,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
       for (rel = i; rel < i + sec->reloc_count; ++rel) 
        {
          unsigned short                 r_type  = rel->r_type;
-         unsigned long                  symndx;
+         long                           symndx;
          struct coff_link_hash_entry *  h;
 
          symndx = rel->r_symndx;
index 1bc231226cf4c2b5d6283022954f46fe43116cbd..19cbea1dc8078dc69f38adc12024939bd09ef875 100644 (file)
@@ -52,10 +52,6 @@ static reloc_howto_type *           mcore_coff_reloc_type_lookup
 static reloc_howto_type *           coff_mcore_rtype_to_howto
   PARAMS ((bfd *, asection *, struct internal_reloc *,
           struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
-static const bfd_target *           pe_object_p
-  PARAMS ((bfd *));
-
-
 \f
 /* The NT loader points the toc register to &toc + 32768, in order to
    use the complete range of a 16-bit displacement. We have to adjust
index de5d657a31eb81ed3952b4e42ea00f57ea31c1db..821fecd4db2c8302fc2275587cd22affb6abc943 100644 (file)
@@ -29,6 +29,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef COFF_WITH_PE
 #include "coff/pe.h"
+
+#ifndef COFF_IMAGE_WITH_PE
+static boolean sh_align_load_span 
+  PARAMS ((bfd *, asection *, bfd_byte *,
+          boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
+          PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *));
+
+#define _bfd_sh_align_load_span sh_align_load_span
+#endif
 #endif
 
 #include "libcoff.h"
@@ -41,7 +50,9 @@ static boolean sh_relax_section
   PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
 static boolean sh_relax_delete_bytes
   PARAMS ((bfd *, asection *, bfd_vma, int));
+#ifndef COFF_IMAGE_WITH_PE
 static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int));
+#endif
 static boolean sh_align_loads
   PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *, boolean *));
 static boolean sh_swap_insns
@@ -402,7 +413,7 @@ get_symbol_value (symbol)
 
 static reloc_howto_type *
 coff_sh_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      asection * sec;
      struct internal_reloc * rel;
      struct coff_link_hash_entry * h;
@@ -1547,7 +1558,7 @@ struct sh_opcode
      mask value in the sh_major_opcode structure.  */
   unsigned short opcode;
   /* Flags for this instruction.  */
-  unsigned short flags;
+  unsigned long flags;
 };
 
 /* Flag which appear in the sh_opcode structure.  */
@@ -1620,6 +1631,7 @@ struct sh_opcode
 #define SETSAS (0x40000)
 #define SETSAS_REG(x) USESAS_REG (x)
 
+#ifndef COFF_IMAGE_WITH_PE
 static boolean sh_insn_uses_reg
   PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
 static boolean sh_insn_sets_reg
@@ -1638,7 +1650,7 @@ static boolean sh_insns_conflict
 static boolean sh_load_use
   PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
           const struct sh_opcode *));
-
+#endif
 /* The opcode maps.  */
 
 #define MAP(a) a, sizeof a / sizeof a[0]
@@ -2101,6 +2113,7 @@ static const struct sh_minor_opcode sh_dsp_opcodef[] =
   { MAP (sh_dsp_opcodef0), 0xfc0d }
 };
 
+#ifndef COFF_IMAGE_WITH_PE
 /* Given an instruction, return a pointer to the corresponding
    sh_opcode structure.  Return NULL if the instruction is not
    recognized.  */
@@ -2384,7 +2397,6 @@ sh_load_use (i1, op1, i2, op2)
   return false;
 }
 
-#ifndef COFF_IMAGE_WITH_PE
 /* Try to align loads and stores within a span of memory.  This is
    called by both the ELF and the COFF sh targets.  ABFD and SEC are
    the BFD and section we are examining.  CONTENTS is the contents of
@@ -2395,6 +2407,9 @@ sh_load_use (i1, op1, i2, op2)
    STOP are the range of memory to examine.  If a swap is made,
    *PSWAPPED is set to true.  */
 
+#ifdef COFF_WITH_PE
+static
+#endif
 boolean
 _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
                         plabel, label_end, start, stop, pswapped)
@@ -2604,7 +2619,7 @@ _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
 
   return true;
 }
-#endif
+#endif /* not COFF_IMAGE_WITH_PE */
 
 /* Look for loads and stores which we can align to four byte
    boundaries.  See the longer comment above sh_relax_section for why
@@ -3112,9 +3127,10 @@ CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NUL
 CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE,
                               SEC_CODE | SEC_DATA, '_', NULL);
 #else
-CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, 0, '_', NULL)
+CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE,
+                              0, '_', NULL)
 #endif
-     
+
 #ifndef TARGET_SHL_SYM
 /* Some people want versions of the SH COFF target which do not align
    to 16 byte boundaries.  We implement that by adding a couple of new
index 25a90bb1e73a741fd0ad3281e7ce08ea2772cf6c..8193a2116ca18fc952cbe61cb54278a5a711f9f1 100644 (file)
@@ -760,7 +760,7 @@ styp_to_sec_flags (abfd, hdr, name, section)
        {
          bfd_byte *esymstart, *esym, *esymend;
          int seen_state = 0;
-         char *target_name;
+         char *target_name = NULL;
 
          esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd);
          esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd);
index bb86497bc9961da6f77519d3c38af56eb3c48c74..498f538a77f0ae205eb8d63f420e6808cb2a5fac 100644 (file)
@@ -849,7 +849,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
            {
              struct elf32_mn10300_link_hash_entry *hash;
              Elf_Internal_Sym *sym;
-             asection *sym_sec;
+             asection *sym_sec = NULL;
              const char *sym_name;
              char *new_name;
 
@@ -930,7 +930,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
                            sym_sec = bfd_abs_section_ptr;
                          else if (isym.st_shndx == SHN_COMMON)
                            sym_sec = bfd_com_section_ptr;
-
+                         
                          sym_name = bfd_elf_string_from_elf_section (input_bfd,
                                                           symtab_hdr->sh_link,
                                                           isym.st_name);
@@ -1193,7 +1193,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
                {
                  Elf_Internal_Sym isym;
                  struct elf32_mn10300_link_hash_entry *sym_hash;
-                 asection *sym_sec;
+                 asection *sym_sec = NULL;
                  const char *sym_name;
                  char *new_name;
 
@@ -1211,7 +1211,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
                    sym_sec = bfd_abs_section_ptr;
                  else if (isym.st_shndx == SHN_COMMON)
                    sym_sec = bfd_com_section_ptr;
-
+                 else
+                   abort ();
+                 
                  sym_name = bfd_elf_string_from_elf_section (input_bfd,
                                                        symtab_hdr->sh_link,
                                                        isym.st_name);
@@ -1461,7 +1463,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
       if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
        {
          Elf_Internal_Sym isym;
-         asection *sym_sec;
+         asection *sym_sec = NULL;
          const char *sym_name;
          char *new_name;
 
@@ -1478,7 +1480,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
            sym_sec = bfd_abs_section_ptr;
          else if (isym.st_shndx == SHN_COMMON)
            sym_sec = bfd_com_section_ptr;
-
+         else
+           abort ();
+         
          symval = (isym.st_value
                    + sym_sec->output_section->vma
                    + sym_sec->output_offset);
index 4d66bcfe299802a8045914940de4b013d9f30b2b..c8bf94326cdecdde83351049fba567e48f062320 100644 (file)
@@ -280,7 +280,7 @@ i370_elf_howto_init ()
 \f
 static reloc_howto_type *
 i370_elf_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   enum i370_reloc_type i370_reloc = R_I370_NONE;
@@ -325,12 +325,12 @@ static boolean i370_elf_section_from_shdr PARAMS ((bfd *,
 static boolean i370_elf_fake_sections PARAMS ((bfd *,
                                               Elf32_Internal_Shdr *,
                                               asection *));
-
+#if 0
 static elf_linker_section_t *i370_elf_create_linker_section
   PARAMS ((bfd *abfd,
           struct bfd_link_info *info,
           enum elf_linker_section_enum));
-
+#endif
 static boolean i370_elf_check_relocs PARAMS ((bfd *,
                                             struct bfd_link_info *,
                                             asection *,
@@ -355,7 +355,7 @@ static boolean i370_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_
 
 static void
 i370_elf_info_to_howto (abfd, cache_ptr, dst)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *cache_ptr;
      Elf32_Internal_Rela *dst;
 {
@@ -482,7 +482,7 @@ i370_elf_section_from_shdr (abfd, hdr, name)
 
 static boolean
 i370_elf_fake_sections (abfd, shdr, asect)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      Elf32_Internal_Shdr *shdr;
      asection *asect;
 {
@@ -496,6 +496,7 @@ i370_elf_fake_sections (abfd, shdr, asect)
 }
 
 \f
+#if 0
 /* Create a special linker section */
 /* XXX hack alert bogus This routine is mostly all junk and almost
  * certainly does the wrong thing.  Its here simply because it does
@@ -571,7 +572,7 @@ i370_elf_create_linker_section (abfd, info, which)
 
   return lsect;
 }
-
+#endif
 \f
 /* We have to create .dynsbss and .rela.sbss here so that they get mapped
    to output sections (just like _bfd_elf_create_dynamic_sections has
@@ -636,7 +637,6 @@ i370_elf_adjust_dynamic_symbol (info, h)
   bfd *dynobj = elf_hash_table (info)->dynobj;
   asection *s;
   unsigned int power_of_two;
-  bfd_vma plt_offset;
 
 #ifdef DEBUG
   fprintf (stderr, "i370_elf_adjust_dynamic_symbol called for %s\n",
@@ -1024,11 +1024,7 @@ i370_elf_check_relocs (abfd, info, sec, relocs)
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   bfd_vma *local_got_offsets;
-  elf_linker_section_t *sdata;
-  elf_linker_section_t *sdata2;
   asection *sreloc;
-  asection *sgot;
-  asection *srelgot = NULL;
 
   if (info->relocateable)
     return true;
@@ -1732,8 +1728,8 @@ int i370_noop()
 
 #define elf_backend_add_symbol_hook \
   (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
-                       const char *, Elf_Internal_Sym *, \
-                       asection *)))                           i370_noop
+                       const Elf_Internal_Sym *, const char **, flagword *, \
+                       asection **, bfd_vma *)))               i370_noop
 #define elf_backend_finish_dynamic_symbol \
   (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
                        struct elf_link_hash_entry *, \
index 518b6bcfd0d4005a8c6d87971980ae48f975d8a5..cc6223017558f5329e58161a54a623f8efc092a7 100644 (file)
@@ -847,8 +847,8 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs)
   unsigned long r_symndx;
   struct elf_link_hash_entry *h;
   bfd *dynobj;
-  asection *sgot;
-  asection *srelgot;
+  asection *sgot = NULL;
+  asection *srelgot = NULL;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
index c8e66dfa183b96315013f6e9320407a4f4b94c25..5963a9eff6ea8d0465e537547384c0ecfc12cdda 100644 (file)
@@ -454,7 +454,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
       Elf_Internal_Sym *           sym = (Elf_Internal_Sym *) 0;
       unsigned long                r_symndx;
       struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0;
-      unsigned short               oldinst;
+      unsigned short               oldinst = 0;
       
       /* Unknown relocation handling */
       if ((unsigned) r_type >= (unsigned) R_MCORE_max
index 2fd04cc9f4b27a67325eafa27c996d71df1c1e5e..05c83ac56ae48329b3d038fd12b3620ef30dd607 100644 (file)
@@ -108,8 +108,10 @@ static void bfd_mips_elf32_swap_gptab_in
   PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *));
 static void bfd_mips_elf32_swap_gptab_out
   PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *));
+#if 0
 static void bfd_mips_elf_swap_msym_in 
   PARAMS ((bfd *, const Elf32_External_Msym *, Elf32_Internal_Msym *));
+#endif
 static void bfd_mips_elf_swap_msym_out
   PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *));
 static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
@@ -2115,7 +2117,7 @@ bfd_mips_elf_swap_options_out (abfd, in, ex)
   bfd_h_put_16 (abfd, in->section, ex->section);
   bfd_h_put_32 (abfd, in->info, ex->info);
 }
-
+#if 0
 /* Swap in an MSYM entry.  */
 
 static void
@@ -2127,7 +2129,7 @@ bfd_mips_elf_swap_msym_in (abfd, ex, in)
   in->ms_hash_value = bfd_h_get_32 (abfd, ex->ms_hash_value);
   in->ms_info = bfd_h_get_32 (abfd, ex->ms_info);
 }
-
+#endif
 /* Swap out an MSYM entry.  */
 
 static void
@@ -5360,7 +5362,7 @@ mips_elf_got_page (abfd, info, value, offsetp)
   struct mips_got_info *g;
   bfd_byte *entry;
   bfd_byte *last_entry;
-  bfd_vma index;
+  bfd_vma index = 0;
   bfd_vma address;
 
   g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
@@ -5409,7 +5411,7 @@ mips_elf_got16_entry (abfd, info, value)
   struct mips_got_info *g;
   bfd_byte *entry;
   bfd_byte *last_entry;
-  bfd_vma index;
+  bfd_vma index = 0;
   bfd_vma address;
 
   /* Although the ABI says that it is "the high-order 16 bits" that we
@@ -6415,7 +6417,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 {
   Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *relend;
-  bfd_vma addend;
+  bfd_vma addend = 0;
   boolean use_saved_addend_p = false;
   struct elf_backend_data *bed;
 
index 19042871ae42eac0973ea04e096aef1898c54c40..ad60e07fd57c66fd2971c04722f8da808b4ce6ef 100644 (file)
@@ -2101,7 +2101,7 @@ sh_elf_set_mach_from_flags (abfd)
 {
   flagword flags = elf_elfheader (abfd)->e_flags;
 
-  switch (elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK)
+  switch (flags & EF_SH_MACH_MASK)
     {
     case EF_SH1:
       bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh);
index 394f1c825641f257e40ffcb9e93f3dfb3adc68cc..bddf290711983dbc640f07a3aa941a4b9d2ba4a6 100644 (file)
@@ -83,7 +83,7 @@ elf_bfd_link_add_symbols (abfd, info)
 /* Return true iff this is a non-common definition of a symbol.  */
 static boolean
 is_global_symbol_definition (abfd, sym)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      Elf_Internal_Sym * sym;
 {
   /* Local symbols do not count, but target specific ones might.  */
index 8f6e454cc62baa396cc4c5862bd3bb550f6fd7d4..9b89369b37b60e0911c62489581f7a014cd47e82 100644 (file)
@@ -41,7 +41,7 @@ static reloc_howto_type *coff_mips_rtype_to_howto
           struct coff_link_hash_entry *, struct internal_syment *,
 
           bfd_vma *));
-
+#if 0
 static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR,
                                              struct internal_reloc *));
 static void mips_ecoff_swap_reloc_out PARAMS ((bfd *,
@@ -52,7 +52,7 @@ static void mips_adjust_reloc_in PARAMS ((bfd *,
                                          arelent *));
 static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *,
                                           struct internal_reloc *));
-
+#endif
 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
 /* The page size is a guess based on ELF.  */
 
@@ -74,9 +74,9 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
      arelent *reloc_entry;
      asymbol *symbol;
      PTR data;
-     asection *input_section;
+     asection *input_section ATTRIBUTE_UNUSED;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   symvalue diff;
 
@@ -169,7 +169,7 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
    appear in the output .reloc section. */
 
 static boolean in_reloc_p(abfd, howto)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      reloc_howto_type *howto;
 {
   return ! howto->pc_relative && howto->type != MIPS_R_RVA;
@@ -310,32 +310,32 @@ static reloc_howto_type howto_table[] =
         0xffff,                /* dst_mask */
         false),                /* pcrel_offset */
 
-  { 8 },
-  { 9 },
-  { 10 },
-  { 11 },
-  { 12 },
-  { 13 },
-  { 14 },
-  { 15 },
-  { 16 },
-  { 17 },
-  { 18 },
-  { 19 },
-  { 20 },
-  { 21 },
-  { 22 },
-  { 23 },
-  { 24 },
-  { 25 },
-  { 26 },
-  { 27 },
-  { 28 },
-  { 29 },
-  { 30 },
-  { 31 },
-  { 32 },
-  { 33 },
+  EMPTY_HOWTO (8),
+  EMPTY_HOWTO (9),
+  EMPTY_HOWTO (10),
+  EMPTY_HOWTO (11),
+  EMPTY_HOWTO (12),
+  EMPTY_HOWTO (13),
+  EMPTY_HOWTO (14),
+  EMPTY_HOWTO (15),
+  EMPTY_HOWTO (16),
+  EMPTY_HOWTO (17),
+  EMPTY_HOWTO (18),
+  EMPTY_HOWTO (19),
+  EMPTY_HOWTO (20),
+  EMPTY_HOWTO (21),
+  EMPTY_HOWTO (22),
+  EMPTY_HOWTO (23),
+  EMPTY_HOWTO (24),
+  EMPTY_HOWTO (25),
+  EMPTY_HOWTO (26),
+  EMPTY_HOWTO (27),
+  EMPTY_HOWTO (28),
+  EMPTY_HOWTO (29),
+  EMPTY_HOWTO (30),
+  EMPTY_HOWTO (31),
+  EMPTY_HOWTO (32),
+  EMPTY_HOWTO (33),
   HOWTO (MIPS_R_RVA,            /* type */                                 
         0,                     /* rightshift */                           
         2,                     /* size (0 = byte, 1 = short, 2 = long) */ 
@@ -349,8 +349,8 @@ static reloc_howto_type howto_table[] =
         0xffffffff,            /* src_mask */                             
         0xffffffff,            /* dst_mask */                             
         false),                /* pcrel_offset */
-  { 35 },
-  { 36 },
+  EMPTY_HOWTO (35),
+  EMPTY_HOWTO (36),
   HOWTO (MIPS_R_PAIR,           /* type */                                 
         0,                     /* rightshift */                           
         2,                     /* size (0 = byte, 1 = short, 2 = long) */ 
@@ -413,7 +413,7 @@ static reloc_howto_type howto_table[] =
 
 static reloc_howto_type *
 coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      struct internal_reloc *rel;
      struct coff_link_hash_entry *h;
@@ -497,7 +497,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
 
 static reloc_howto_type *
 coff_mips_reloc_type_lookup (abfd, code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   int mips_type;
@@ -644,18 +644,13 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
      struct internal_syment *syms;
      asection **sections;
 {
-  asection **symndx_to_section;
-  struct ecoff_link_hash_entry **sym_hashes;
-  struct coff_link_hash_entry *h;
   bfd_vma gp;
   boolean gp_undefined;
   size_t adjust;
-  long *offsets;
   struct internal_reloc *rel;
   struct internal_reloc *rel_end;
   unsigned int i;
   boolean got_lo;
-  struct internal_reloc lo_int_rel;
 
   if (info->relocateable)
   {
@@ -695,7 +690,6 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
       bfd_vma addend = 0;
       bfd_vma val, tmp, targ, src, low;
       reloc_howto_type *howto;
-      bfd_reloc_status_type rstat;
       unsigned char *mem = contents + rel->r_vaddr;
 
       symndx = rel->r_symndx;
@@ -821,7 +815,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
        case MIPS_R_JMPADDR:
          tmp = bfd_get_32(input_bfd, mem);
          targ = val + (tmp&0x03ffffff)*4;
-         if (src & 0xf0000000 != targ & 0xf0000000)
+         if ((src & 0xf0000000) != (targ & 0xf0000000))
            {
              (*_bfd_error_handler)(_("%s: jump too far away\n"),
                                    bfd_get_filename (input_bfd));
@@ -894,7 +888,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
          tmp = bfd_get_32 (input_bfd, mem);
          /* printf("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
          tmp += val
-        - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
+           - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
          bfd_put_32 (input_bfd, tmp, mem);
          break;
 
index b94d0f8449767a589da0e8e8b7a3bbc7eb8bdd4a..539cd7bc84bce3a241d8f0d2745da47a70b0ba9e 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for the generic parts of PE/PEI, for BFD.
-   Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    Written by Cygnus Solutions.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -697,7 +697,7 @@ typedef struct
 }
 jump_table;
 
-jump_table jtab[] =
+static jump_table jtab[] =
 {
 #ifdef I386MAGIC
   { I386MAGIC,
@@ -761,7 +761,7 @@ pe_ILF_build_a_bfd (bfd *           abfd,
   struct internal_filehdr  internal_f;
   unsigned int             import_type;
   unsigned int             import_name_type;
-  asection_ptr             id2, id4, id5, id6, id7, text;
+  asection_ptr             id2, id4, id5, id6 = NULL, id7, text;
 
   text = NULL;
   
@@ -1197,7 +1197,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
   source_dll  = ptr + strlen (ptr) + 1;
   
   /* Verify that the strings are null terminated.  */
-  if (ptr[size - 1] != 0 || ((source_dll - ptr) >= size))
+  if (ptr[size - 1] != 0 || ((unsigned long)(source_dll - ptr) >= size))
     {
       _bfd_error_handler
        (_("%s: string not null terminated in ILF object file."),