aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJohn Darrington <john@darrington.wattle.id.au>2018-10-03 12:26:42 +0200
committerJohn Darrington <john@darrington.wattle.id.au>2018-10-23 16:09:30 +0200
commit2849d19feb458ade67cdcc6a82f0e7b1be99b46b (patch)
treead7171222c73e3906dd555edd8c1568831928810 /bfd
parent405b61965ff7608840cfda36083c1be1f926ccdb (diff)
downloadgdb-2849d19feb458ade67cdcc6a82f0e7b1be99b46b.zip
gdb-2849d19feb458ade67cdcc6a82f0e7b1be99b46b.tar.gz
gdb-2849d19feb458ade67cdcc6a82f0e7b1be99b46b.tar.bz2
S12Z: New 32 bit Reloc.
Third party tools produce 32 bit relocs at index 6 with strange properties. This change moves the existing 32 bit reloc (R_S12Z_EXT32) to index 7 and introduces a new one (R_S12Z_CW32) at index 6 to try to support code generated by these tools. * bfd/elf32-s12z.c (elf_s12z_howto_table) [R_S12Z_CW32]: New member. * binutils/readelf.c (is_32bit_abs_reloc): Reloc type 7 is also 32 bit. * include/elf/s12z.h (elf_s12z_reloc_tpe) [RELOC_NUMBER (R_S12Z_CW32)]: New enum.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf32-s12z.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/bfd/elf32-s12z.c b/bfd/elf32-s12z.c
index d2ea4ec..05e5153 100644
--- a/bfd/elf32-s12z.c
+++ b/bfd/elf32-s12z.c
@@ -183,6 +183,29 @@ static reloc_howto_type elf_s12z_howto_table[] =
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 */