Correct PR number in changelog entry.
[binutils-gdb.git] / bfd / elf32-s12z.c
index cab54c487b3af539289e0f199c064652e2aa0b1b..57681cf8ca8eb17605d5b2f3462feb5099c20861 100644 (file)
@@ -1,5 +1,5 @@
 /* Freescale S12Z-specific support for 32-bit ELF
-   Copyright (C) 1999-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999-2019 Free Software Foundation, Inc.
    (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -119,7 +119,7 @@ static reloc_howto_type elf_s12z_howto_table[] =
         shift_addend_reloc,
         "R_S12Z_OPR",  /* name */
         FALSE,                 /* partial_inplace */
-        0x00ffffff,            /* src_mask */
+        0x00000000,            /* src_mask */
         0x00ffffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
@@ -164,7 +164,7 @@ static reloc_howto_type elf_s12z_howto_table[] =
         bfd_elf_generic_reloc, /* special_function */
         "R_S12Z_EXT24",        /* name */
         FALSE,                 /* partial_inplace */
-        0x00ffffff,            /* src_mask */
+        0x00000000,            /* src_mask */
         0x00ffffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
@@ -179,10 +179,33 @@ static reloc_howto_type elf_s12z_howto_table[] =
         opru18_reloc,          /* special_function */
         "R_S12Z_EXT18",        /* name */
         FALSE,                 /* partial_inplace */
-        0x0005ffff,            /* src_mask */
+        0x00000000,            /* src_mask */
         0x0005ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
+  /* A 32 bit absolute relocation.   This kind of relocation is
+     schizophrenic - Although they appear in sections named .rela.debug.*
+     in some sections they behave as RELA relocs, but in others they have
+     an added of zero and behave as REL.
+
+     It is not recommended that new code  emits this reloc.   It is here
+     only to support existing elf files generated by third party
+     applications.  */
+
+  HOWTO (R_S12Z_CW32,        /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield,    /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_S12Z_CW32", /* name */
+        FALSE,                 /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
   /* A 32 bit absolute relocation  */
   HOWTO (R_S12Z_EXT32,        /* type */
         0,                     /* rightshift */
@@ -194,7 +217,7 @@ static reloc_howto_type elf_s12z_howto_table[] =
         bfd_elf_generic_reloc, /* special_function */
         "R_S12Z_EXT32",        /* name */
         FALSE,                 /* partial_inplace */
-        0xffffffff,            /* src_mask */
+        0x00000000,            /* src_mask */
         0xffffffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 };
@@ -243,8 +266,6 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 {
   unsigned int i;
 
-  printf ("%s:%d Looking up %s\n", __FILE__, __LINE__, r_name);
-
   for (i = 0;
        i < (sizeof (elf_s12z_howto_table)
            / sizeof (elf_s12z_howto_table[0]));