summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-03-01 20:39:07 +0000
committerNick Clifton <nickc@redhat.com>2000-03-01 20:39:07 +0000
commit6411b473f191088dafb03c3ebe958974a0ea7953 (patch)
tree003e87ba1459939f3a129b3f08bb15a40952d6cf
parent77f9ff74cdb7619352fd286b90fbd31293a58f2b (diff)
downloadbinutils-redhat-6411b473f191088dafb03c3ebe958974a0ea7953.tar.gz
Fix building with --enable-targets=all
-rw-r--r--bfd/ChangeLog55
-rw-r--r--bfd/bfd-in.h10
-rw-r--r--bfd/bfd-in2.h10
-rw-r--r--bfd/coff-arm.c2
-rw-r--r--bfd/coff-mcore.c4
-rw-r--r--bfd/coff-sh.c30
-rw-r--r--bfd/coffcode.h2
-rw-r--r--bfd/elf-m10300.c16
-rw-r--r--bfd/elf32-i370.c22
-rw-r--r--bfd/elf32-m68k.c4
-rw-r--r--bfd/elf32-mcore.c2
-rw-r--r--bfd/elf32-mips.c12
-rw-r--r--bfd/elf32-sh.c2
-rw-r--r--bfd/elflink.h2
-rw-r--r--bfd/pe-mips.c80
-rw-r--r--bfd/peicode.h8
16 files changed, 172 insertions, 89 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 631c7e8901..640362fd56 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 15aa3a6558..1f67c0c3a2 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -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 *));
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 519ad86035..5c8338e29d 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -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 *));
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index 5bb7be6f6a..2b89b848c8 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -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;
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index 1bc231226c..19cbea1dc8 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -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 *));
-
-
/* 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
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index de5d657a31..821fecd4db 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -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
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 25a90bb1e7..8193a2116c 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -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);
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index bb86497bc9..498f538a77 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -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);
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 4d66bcfe29..c8bf94326c 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -280,7 +280,7 @@ i370_elf_howto_init ()
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)
}
+#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
/* 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 *, \
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 518b6bcfd0..cc62230175 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -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);
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index c8e66dfa18..5963a9eff6 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -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
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 2fd04cc9f4..05c83ac56a 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -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;
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 19042871ae..ad60e07fd5 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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);
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 394f1c8256..bddf290711 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -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. */
diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c
index 8f6e454cc6..9b89369b37 100644
--- a/bfd/pe-mips.c
+++ b/bfd/pe-mips.c
@@ -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;
diff --git a/bfd/peicode.h b/bfd/peicode.h
index b94d0f8449..539cd7bc84 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -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."),