CSKY: Fix special_function in howto table
authorLifang Xia <lifang_xia@c-sky.com>
Wed, 14 Apr 2021 09:18:13 +0000 (17:18 +0800)
committerLifang Xia <lifang_xia@c-sky.com>
Thu, 15 Apr 2021 02:07:35 +0000 (10:07 +0800)
The special_function for reloc should be 'bfd_elf_generic_reloc',
reloc list:
R_CKCORE_PCREL_IMM16BY2,
R_CKCORE_PCREL_IMM16BY4,
R_CKCORE_PCREL_IMM10BY4,
R_CKCORE_PCREL_IMM18BY2,
R_CKCORE_PCREL_FLRW_IMM8BY4

bfd/
* elf32-csky.c (csky_elf_howto_table)
<R_CKCORE_PCREL_IMM16BY2>: Set special_function to
bfd_elf_generic_reloc.
<R_CKCORE_PCREL_IMM16BY4>: Likewise.
<R_CKCORE_PCREL_IMM10BY4>: Likewise.
<R_CKCORE_PCREL_IMM18BY2>: Likewise.
<R_CKCORE_PCREL_FLRW_IMM8BY4>: Likewise.

bfd/ChangeLog
bfd/elf32-csky.c

index 6c89655664f50bc29b29fd92b591547d39debebe..4884aaba38451b0571d5dda8ad8bb23c7b96a92e 100644 (file)
@@ -1,3 +1,13 @@
+2021-04-15  Lifang Xia<lifang_xia@c-sky.com>
+
+       * elf32-csky.c (csky_elf_howto_table)
+       <R_CKCORE_PCREL_IMM16BY2>: Set special_function to
+       bfd_elf_generic_reloc.
+       <R_CKCORE_PCREL_IMM16BY4>: Likewise.
+       <R_CKCORE_PCREL_IMM10BY4>: Likewise.
+       <R_CKCORE_PCREL_IMM18BY2>: Likewise.
+       <R_CKCORE_PCREL_FLRW_IMM8BY4>: Likewise.
+
 2021-04-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/27708
index f8209a4a7da46bd9b144a3e0dc7d2b7dc5c95384..3ab4639cbae92933890cd6e91b9aad64a62ac298 100644 (file)
@@ -324,33 +324,33 @@ static reloc_howto_type csky_elf_howto_table[] =
 
   /* 20: Only for csky v2.  */
   HOWTO (R_CKCORE_PCREL_IMM16BY2,     /* type */
-        1,                           /* rightshift */
-        2,                           /* size */
-        16,                          /* bitsize */
-        true,                        /* pc_relative */
-        0,                           /* bitpos */
-        complain_overflow_signed,    /* complain_on_overflow */
-        NULL,                        /* special_function */
-        "R_CKCORE_PCREL_IMM16BY2",   /* name */
-        false,                       /* partial_inplace */
-        0x0,                         /* src_mask */
-        0xffff,                      /* dst_mask */
-        true),                       /* pcrel_offset */
+         1,                           /* rightshift */
+         2,                           /* size */
+         16,                          /* bitsize */
+         true,                        /* pc_relative */
+         0,                           /* bitpos */
+         complain_overflow_signed,    /* complain_on_overflow */
+         bfd_elf_generic_reloc,       /* special_function */
+         "R_CKCORE_PCREL_IMM16BY2",   /* name */
+         false,                       /* partial_inplace */
+         0x0,                         /* src_mask */
+         0xffff,                      /* dst_mask */
+         true),                       /* pcrel_offset */
 
   /* 21: Only for csky v2.  */
   HOWTO (R_CKCORE_PCREL_IMM16BY4,     /* type */
-        2,                           /* rightshift */
-        2,                           /* size */
-        16,                          /* bitsize */
-        true,                        /* pc_relative */
-        0,                           /* bitpos */
-        complain_overflow_bitfield,  /* complain_on_overflow */
-        NULL,                        /* special_function */
-        "R_CKCORE_PCREL_IMM16BY4",   /* name */
-        false,                       /* partial_inplace */
-        0xffff0000,                  /* src_mask */
-        0xffff,                      /* dst_mask */
-        true),                       /* pcrel_offset */
+         2,                           /* rightshift */
+         2,                           /* size */
+         16,                          /* bitsize */
+         true,                        /* pc_relative */
+         0,                           /* bitpos */
+         complain_overflow_bitfield,  /* complain_on_overflow */
+         bfd_elf_generic_reloc,       /* special_function */
+         "R_CKCORE_PCREL_IMM16BY4",   /* name */
+         false,                       /* partial_inplace */
+         0xffff0000,                  /* src_mask */
+         0xffff,                      /* dst_mask */
+         true),                       /* pcrel_offset */
 
   /* 22: Only for csky v2.  */
   HOWTO (R_CKCORE_PCREL_IMM10BY2,     /* type */
@@ -369,18 +369,18 @@ static reloc_howto_type csky_elf_howto_table[] =
 
   /* 23: Only for csky v2.  */
   HOWTO (R_CKCORE_PCREL_IMM10BY4,     /* type */
-        2,                           /* rightshift */
-        2,                           /* size */
-        10,                          /* bitsize */
-        true,                        /* pc_relative */
-        0,                           /* bitpos */
-        complain_overflow_bitfield,  /* complain_on_overflow */
-        NULL,                        /* special_function */
-        "R_CKCORE_PCREL_IMM10BY4",   /* name */
-        false,                       /* partial_inplace */
-        0x0,                         /* src_mask */
-        0x3ff,                       /* dst_mask */
-        true),                       /* pcrel_offset */
+         2,                           /* rightshift */
+         2,                           /* size */
+         10,                          /* bitsize */
+         true,                        /* pc_relative */
+         0,                           /* bitpos */
+         complain_overflow_bitfield,  /* complain_on_overflow */
+         bfd_elf_generic_reloc,       /* special_function */
+         "R_CKCORE_PCREL_IMM10BY4",   /* name */
+         false,                       /* partial_inplace */
+         0x0,                         /* src_mask */
+         0x3ff,                       /* dst_mask */
+         true),                       /* pcrel_offset */
 
   /* 24: Only for csky v2.  */
   HOWTO (R_CKCORE_ADDR_HI16,          /* type */
@@ -621,18 +621,18 @@ static reloc_howto_type csky_elf_howto_table[] =
 
   /* 43.  */
   HOWTO (R_CKCORE_PCREL_IMM18BY2,     /* type */
-        1,                           /* rightshift */
-        2,                           /* size */
-        18,                          /* bitsize */
-        true,                        /* pc_relative */
-        0,                           /* bitpos */
-        complain_overflow_signed,    /* complain_on_overflow */
-        NULL,                        /* special_function */
-        "R_CKCORE_PCREL_IMM18BY2",   /* name */
-        false,                       /* partial_inplace */
-        0x0,                         /* src_mask */
-        0x3ffff,                     /* dst_mask */
-        true),                       /* pcrel_offset */
+         1,                           /* rightshift */
+         2,                           /* size */
+         18,                          /* bitsize */
+         true,                        /* pc_relative */
+         0,                           /* bitpos */
+         complain_overflow_signed,    /* complain_on_overflow */
+         bfd_elf_generic_reloc,       /* special_function */
+         "R_CKCORE_PCREL_IMM18BY2",   /* name */
+         false,                       /* partial_inplace */
+         0x0,                         /* src_mask */
+         0x3ffff,                     /* dst_mask */
+         true),                       /* pcrel_offset */
 
   /* 44.  */
   HOWTO (R_CKCORE_DOFFSET_IMM18,      /* type */
@@ -825,18 +825,18 @@ static reloc_howto_type csky_elf_howto_table[] =
 
   /* 59: for ck807f.  */
   HOWTO (R_CKCORE_PCREL_FLRW_IMM8BY4, /* type */
-        2,                           /* rightshift */
-        2,                           /* size */
-        8,                           /* bitsize */
-        true,                        /* pc_relative */
-        0,                           /* bitpos */
-        complain_overflow_bitfield,  /* complain_on_overflow */
-        NULL,                        /* special_function */
-        "R_CKCORE_PCREL_FLRW_IMM8BY4", /* name */
-        false,                       /* partial_inplace */
-        0xfe1fff0f,                  /* src_mask */
-        0x1e000f0,                   /* dst_mask */
-        true),                       /* pcrel_offset */
+         2,                           /* rightshift */
+         2,                           /* size */
+         8,                           /* bitsize */
+         true,                        /* pc_relative */
+         0,                           /* bitpos */
+         complain_overflow_bitfield,  /* complain_on_overflow */
+         bfd_elf_generic_reloc,       /* special_function */
+         "R_CKCORE_PCREL_FLRW_IMM8BY4",/* name */
+         false,                       /* partial_inplace */
+         0xfe1fff0f,                  /* src_mask */
+         0x1e000f0,                   /* dst_mask */
+         true),                       /* pcrel_offset */
 
   /* 60: for 810 not to generate jsri.  */
   HOWTO (R_CKCORE_NOJSRI,             /* type */