aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-08-31 13:01:59 +0930
committerAlan Modra <amodra@gmail.com>2015-08-31 13:01:59 +0930
commit6cae483a9dc8d07c2743067d32026650b7eb37a9 (patch)
tree72aa4462b2a31d808b6dd9cb45b9f9345533ac89
parent1292acf8fd4450703ee407e55f6b5a29c044d009 (diff)
downloadgdb-6cae483a9dc8d07c2743067d32026650b7eb37a9.zip
gdb-6cae483a9dc8d07c2743067d32026650b7eb37a9.tar.gz
gdb-6cae483a9dc8d07c2743067d32026650b7eb37a9.tar.bz2
NDS32 build fixes
* elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix. (find_relocs_at_address_addr): Make "reloc_type" an enum. (nds32_elf_relax_delete_blanks): Warning fix. (nds32_elf_relax_loadstore): Correct loop bound.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-nds32.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8a29777..713073a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
2015-08-31 Alan Modra <amodra@gmail.com>
+ * elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix.
+ (find_relocs_at_address_addr): Make "reloc_type" an enum.
+ (nds32_elf_relax_delete_blanks): Warning fix.
+ (nds32_elf_relax_loadstore): Correct loop bound.
+
+2015-08-31 Alan Modra <amodra@gmail.com>
+
* section.c (struct bfd_section): Make "id" and "index" unsigned.
* coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
* elf.c (elf_map_symbols): Likewise.
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index 5b8e9d6..e591100 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -6868,7 +6868,7 @@ nds32_convert_32_to_16_alu1 (bfd *abfd, uint32_t insn, uint16_t *pinsn16,
int *pinsn_type)
{
uint16_t insn16 = 0;
- int insn_type;
+ int insn_type = 0;
unsigned long mach = bfd_get_mach (abfd);
if (N32_SH5 (insn) != 0)
@@ -8331,7 +8331,7 @@ static Elf_Internal_Rela *
find_relocs_at_address_addr (Elf_Internal_Rela *reloc,
Elf_Internal_Rela *relocs,
Elf_Internal_Rela *irelend,
- unsigned char reloc_type,
+ enum elf_nds32_reloc_type reloc_type,
bfd_vma offset_p)
{
Elf_Internal_Rela *rel_t = NULL;
@@ -8682,7 +8682,7 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec,
unsigned long val = 0;
unsigned long mask;
long before, between;
- long offset;
+ long offset = 0;
switch (ELF32_R_TYPE (irel->r_info))
{
@@ -10787,7 +10787,8 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd,
bfd_byte *contents, Elf_Internal_Sym *isymbuf,
Elf_Internal_Shdr *symtab_hdr, int load_store_relax)
{
- int eliminate_sethi = 0, range_type, i;
+ int eliminate_sethi = 0, range_type;
+ unsigned int i;
bfd_vma local_sda, laddr;
int seq_len; /* Original length of instruction sequence. */
uint32_t insn;
@@ -10807,7 +10808,7 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd,
*insn_len = seq_len;
/* Get the high part relocation. */
- for (i = 0; (unsigned) i < sizeof (checked_types); i++)
+ for (i = 0; i < ARRAY_SIZE (checked_types); i++)
{
hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend,
checked_types[i], laddr);