]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf32-rx.c
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / bfd / elf32-rx.c
index e28edb6f689b4ca818aff923d1dd3d2ea2d4a5bd..1b7b35b01f0703ff2eaa022e3394b4bbf850d075 100644 (file)
@@ -543,7 +543,7 @@ rx_elf_relocate_section
 
          name = bfd_elf_string_from_elf_section
            (input_bfd, symtab_hdr->sh_link, sym->st_name);
-         name = (sym->st_name == 0) ? bfd_section_name (input_bfd, sec) : name;
+         name = sym->st_name == 0 ? bfd_section_name (sec) : name;
        }
       else
        {
@@ -2932,9 +2932,9 @@ elf32_rx_relax_section (bfd *                    abfd,
                  break;
                case 0:
 #if RX_OPCODE_BIG_ENDIAN
-                 imm_val = (ip[0] << 24) | (ip[1] << 16) | (ip[2] << 8) | ip[3];
+                 imm_val = ((unsigned) ip[0] << 24) | (ip[1] << 16) | (ip[2] << 8) | ip[3];
 #else
-                 imm_val = (ip[3] << 24) | (ip[2] << 16) | (ip[1] << 8) | ip[0];
+                 imm_val = ((unsigned) ip[3] << 24) | (ip[2] << 16) | (ip[1] << 8) | ip[0];
 #endif
                  break;
                }
@@ -3212,7 +3212,12 @@ elf32_rx_machine (bfd * abfd ATTRIBUTE_UNUSED)
         For now we assume that the flags are OK.  */
   if ((elf_elfheader (abfd)->e_flags & EF_RX_CPU_MASK) == EF_RX_CPU_RX)
 #endif
-    return bfd_mach_rx;
+    if ((elf_elfheader (abfd)->e_flags & E_FLAG_RX_V2))
+      return bfd_mach_rx_v2;
+    else if ((elf_elfheader (abfd)->e_flags & E_FLAG_RX_V3))
+      return bfd_mach_rx_v3;
+    else
+      return bfd_mach_rx;
 
   return 0;
 }
@@ -3313,8 +3318,7 @@ rx_elf_object_p (bfd * abfd)
 static bfd_boolean
 rx_linux_object_p (bfd * abfd)
 {
-  bfd_default_set_arch_mach (abfd, bfd_arch_rx,
-           elf32_rx_machine (abfd));
+  bfd_default_set_arch_mach (abfd, bfd_arch_rx, elf32_rx_machine (abfd));
   return TRUE;
 }
  \f
@@ -3680,8 +3684,7 @@ rx_final_link (bfd * abfd, struct bfd_link_info * info)
 }
 
 static bfd_boolean
-elf32_rx_modify_program_headers (bfd * abfd ATTRIBUTE_UNUSED,
-                                struct bfd_link_info * info ATTRIBUTE_UNUSED)
+elf32_rx_modify_headers (bfd *abfd, struct bfd_link_info *info)
 {
   const struct elf_backend_data * bed;
   struct elf_obj_tdata * tdata;
@@ -3713,7 +3716,7 @@ elf32_rx_modify_program_headers (bfd * abfd ATTRIBUTE_UNUSED,
 #endif
        }
 
-  return TRUE;
+  return _bfd_elf_modify_headers (abfd, info);
 }
 
 /* The default literal sections should always be marked as "code" (i.e.,
@@ -4033,7 +4036,7 @@ rx_additional_link_map_text (bfd *obfd, struct bfd_link_info *info, FILE *mapfil
 #define elf_backend_relocate_section           rx_elf_relocate_section
 #define elf_symbol_leading_char                        ('_')
 #define elf_backend_can_gc_sections            1
-#define elf_backend_modify_program_headers     elf32_rx_modify_program_headers
+#define elf_backend_modify_headers             elf32_rx_modify_headers
 
 #define bfd_elf32_bfd_reloc_type_lookup                rx_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup                rx_reloc_name_lookup
@@ -4078,6 +4081,6 @@ rx_additional_link_map_text (bfd *obfd, struct bfd_link_info *info, FILE *mapfil
 #define elf_backend_object_p                   rx_linux_object_p
 #undef  elf_symbol_leading_char
 #undef elf32_bed
-#define        elf32_bed                               elf32_rx_le_linux_bed
+#define        elf32_bed                               elf32_rx_le_linux_bed
 
 #include "elf32-target.h"