Prefer object over notype symbols when disassembling
[deliverable/binutils-gdb.git] / bfd / elf32-s12z.c
index 57681cf8ca8eb17605d5b2f3462feb5099c20861..f8f46ba34b71696f01add4ff39d1b50453fa9255 100644 (file)
@@ -27,6 +27,9 @@
 
 #include "elf/s12z.h"
 
+/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1.  */
+#define OCTETS_PER_BYTE(ABFD, SEC) 1
+
 /* Relocation functions.  */
 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
   (bfd *, bfd_reloc_code_real_type);
@@ -43,7 +46,8 @@ opru18_reloc (bfd *abfd, arelent *reloc_entry, struct bfd_symbol *symbol,
      is shifted one place to the left of where it would normally be.  See
      Appendix A.4 of the S12Z reference manual.  */
 
-  bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+  bfd_size_type octets = (reloc_entry->address
+                         * OCTETS_PER_BYTE (abfd, input_section));
   bfd_vma result = bfd_get_24 (abfd, (unsigned char *) data + octets);
   bfd_vma val = bfd_asymbol_value (symbol);
 
@@ -119,7 +123,7 @@ static reloc_howto_type elf_s12z_howto_table[] =
         shift_addend_reloc,
         "R_S12Z_OPR",  /* name */
         FALSE,                 /* partial_inplace */
-        0x00000000,            /* src_mask */
+        0x00ffffff,            /* src_mask */
         0x00ffffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
@@ -232,11 +236,12 @@ struct s12z_reloc_map
 
 static const struct s12z_reloc_map s12z_reloc_map[] =
 {
-  /* bfd reloc val */ /* elf reloc val */
-  {BFD_RELOC_NONE, R_S12Z_NONE},
-  {BFD_RELOC_32, R_S12Z_EXT32},
-  {BFD_RELOC_24, R_S12Z_EXT24},
-  {BFD_RELOC_16_PCREL, R_S12Z_PCREL_7_15}
+  /* bfd reloc val */  /* elf reloc val */
+  {BFD_RELOC_NONE,     R_S12Z_NONE},
+  {BFD_RELOC_32,       R_S12Z_EXT32},
+  {BFD_RELOC_24,       R_S12Z_EXT24},
+  {BFD_RELOC_16_PCREL, R_S12Z_PCREL_7_15},
+  {BFD_RELOC_S12Z_OPR, R_S12Z_OPR}
 };
 
 static reloc_howto_type *
@@ -316,7 +321,5 @@ s12z_elf_set_mach_from_flags (bfd *abfd)
 #define elf_info_to_howto                      NULL
 #define elf_info_to_howto_rel                  s12z_info_to_howto_rel
 #define elf_backend_object_p                   s12z_elf_set_mach_from_flags
-#define elf_backend_final_write_processing     NULL
-#define elf_backend_can_gc_sections            1
 
 #include "elf32-target.h"
This page took 0.026165 seconds and 4 git commands to generate.