OSDN Git Service

* cpu-arm.c (arm_check_note): Warning fix.
authorAlan Modra <amodra@bigpond.net.au>
Fri, 9 May 2003 11:35:35 +0000 (11:35 +0000)
committerAlan Modra <amodra@bigpond.net.au>
Fri, 9 May 2003 11:35:35 +0000 (11:35 +0000)
* elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes.  Arrange
to keep relocs if edited.
(iq2000_elf_print_private_bfd_data): Return TRUE.
* elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
ELF64_R_SYM.
(elfNN_ia64_relax_ldxmov): Warning fix.
* xtensa-isa.c (xtensa_add_isa): Warning fix.
* xtensa-modules.c (get_num_opcodes): Warning fix.

bfd/ChangeLog
bfd/cpu-arm.c
bfd/elf32-iq2000.c
bfd/elfxx-ia64.c
bfd/xtensa-isa.c
bfd/xtensa-modules.c

index 0248133..b9fb970 100644 (file)
@@ -1,3 +1,15 @@
+2003-05-09  Alan Modra  <amodra@bigpond.net.au>
+
+       * cpu-arm.c (arm_check_note): Warning fix.
+       * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes.  Arrange
+       to keep relocs if edited.
+       (iq2000_elf_print_private_bfd_data): Return TRUE.
+       * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
+       ELF64_R_SYM.
+       (elfNN_ia64_relax_ldxmov): Warning fix.
+       * xtensa-isa.c (xtensa_add_isa): Warning fix.
+       * xtensa-modules.c (get_num_opcodes): Warning fix.
+
 2003-05-09  Andrey Petrov <petrov@netbsd.org>
 
        * elf.c (elf_fake_sections): Use correct cast for sh_name.
index 66c3a46..9ef527c 100644 (file)
@@ -260,7 +260,7 @@ arm_check_note (abfd, buffer, buffer_size, expected_name, description_return)
     }
   else
     { 
-      if (namesz != (strlen (expected_name) + 1 + 3) & ~3)
+      if (namesz != ((strlen (expected_name) + 1 + 3) & ~3))
        return FALSE;
       
       if (strcmp (descr, expected_name) != 0)
index c4261bf..ebdd303 100644 (file)
@@ -454,8 +454,9 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
 {
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
-  Elf_Internal_Rela *rel;
-  Elf_Internal_Rela *rel_end;
+  const Elf_Internal_Rela *rel;
+  const Elf_Internal_Rela *rel_end;
+  bfd_boolean changed = FALSE;
   
   if (info->relocateable)
     return TRUE;
@@ -499,10 +500,20 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
          if (memcmp (sec->name, ".debug", 6) == 0
              || memcmp (sec->name, ".stab", 5) == 0
              || memcmp (sec->name, ".eh_frame", 9) == 0)
-           rel->r_info = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
+           {
+             ((Elf_Internal_Rela *) rel)->r_info
+               = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
+             changed = TRUE;
+           }
          break;
        }
     }
+
+  if (changed)
+    /* Note that we've changed relocs, otherwise if !info->keep_memory
+       we'll free the relocs and lose our changes.  */
+    (const Elf_Internal_Rela *) (elf_section_data (sec)->relocs) = relocs;
+
   return TRUE;
 }
 
@@ -929,6 +940,7 @@ iq2000_elf_print_private_bfd_data (abfd, ptr)
     }
 
   fputc ('\n', file);
+  return TRUE;
 }
 
 static
index 65713a0..ab2ff21 100644 (file)
@@ -796,7 +796,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
                goto error_return;
            }
 
-         isym = isymbuf + ELF64_R_SYM (irel->r_info);
+         isym = isymbuf + ELFNN_R_SYM (irel->r_info);
          if (isym->st_shndx == SHN_UNDEF)
            continue;   /* We can't do anthing with undefined symbols.  */
          else if (isym->st_shndx == SHN_ABS)
@@ -1089,7 +1089,7 @@ elfNN_ia64_relax_ldxmov (abfd, contents, off)
     case 0: shift =  5; break;
     case 1: shift = 14; off += 3; break;
     case 2: shift = 23; off += 6; break;
-    case 3:
+    default:
       abort ();
     }
 
index ffbef53..761e5c6 100644 (file)
@@ -159,7 +159,7 @@ configuration.\n"
 static int
 xtensa_add_isa (xtensa_isa_internal *isa, libisa_module_specifier libisa)
 {
-  const int (*get_num_opcodes_fn) (void);
+  int (*get_num_opcodes_fn) (void);
   struct config_struct *(*get_config_table_fn) (void);
   xtensa_opcode_internal **(*get_opcodes_fn) (void);
   int (*decode_insn_fn) (const xtensa_insnbuf);
index d023b52..e5d7682 100644 (file)
@@ -41,7 +41,7 @@ tie_undo_reloc_l (uint32 offset, uint32 pc)
 }
 
 xtensa_opcode_internal** get_opcodes (void);
-const int get_num_opcodes (void);
+int get_num_opcodes (void);
 int decode_insn (const xtensa_insnbuf);
 int interface_version (void);
 
@@ -5463,7 +5463,7 @@ get_opcodes (void)
   return &opcodes[0];
 }
 
-const int
+int
 get_num_opcodes (void)
 {
   return 149;