aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m32c.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-07-26 03:21:53 +0000
committerDJ Delorie <dj@redhat.com>2005-07-26 03:21:53 +0000
commitfd54057a29e296d29e662780fc6079e42c742228 (patch)
tree1a109b9e7d8a9108edda9722d9e1f392e74cf070 /bfd/elf32-m32c.c
parent030cf60a5d8687b18dbe76050ee33490fc96e075 (diff)
downloadgdb-fd54057a29e296d29e662780fc6079e42c742228.zip
gdb-fd54057a29e296d29e662780fc6079e42c742228.tar.gz
gdb-fd54057a29e296d29e662780fc6079e42c742228.tar.bz2
[bfd]
* reloc.c: Remove unused M32C relocs, add BFD_RELOC_M32C_HI8. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. * elf32-m32c.c (m32c_elf_howto_table): Add R_M32C_8, R_M32C_LO16, R_M32C_HI8, R_M32C_HI16. (m32c_reloc_map): Likewise. (m32c_elf_relocate_section): Add R_M32C_HI8 and R_M32C_HI16. [cpu] * m32c.opc (parse_unsigned8): Add %dsp8(). (parse_signed8): Add %hi8(). (parse_unsigned16): Add %dsp16(). (parse_signed16): Add %lo16() and %hi16(). (parse_lab_5_3): Make valuep a bfd_vma *. [gas] * config/tc-m32c.c (md_cgen_lookup_reloc): Add 8 bit operands. Support %mod() modifiers from opcodes. * doc/c-m32c.texi (M32C-Modifiers): New section. [include/elf] * m32c.h: Add R_M32C_8, R_M32C_LO16, R_M32C_HI8, and R_M32C_HI16. [opcodes] * m32c-asm.c Regenerate. * m32c-dis.c Regenerate.
Diffstat (limited to 'bfd/elf32-m32c.c')
-rw-r--r--bfd/elf32-m32c.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index 3f9bb4e..35136af 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -132,6 +132,62 @@ static reloc_howto_type m32c_elf_howto_table [] =
0, /* src_mask */
0, /* dst_mask */
TRUE), /* pcrel_offset */
+
+ HOWTO (R_M32C_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M32C_8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_M32C_LO16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M32C_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_M32C_HI8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M32C_HI8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_M32C_HI16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M32C_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
/* Map BFD reloc types to M32C ELF reloc types. */
@@ -149,7 +205,11 @@ static const struct m32c_reloc_map m32c_reloc_map [] =
{ BFD_RELOC_24, R_M32C_24 },
{ BFD_RELOC_32, R_M32C_32 },
{ BFD_RELOC_8_PCREL, R_M32C_8_PCREL },
- { BFD_RELOC_16_PCREL, R_M32C_16_PCREL }
+ { BFD_RELOC_16_PCREL, R_M32C_16_PCREL },
+ { BFD_RELOC_8, R_M32C_8 },
+ { BFD_RELOC_LO16, R_M32C_LO16 },
+ { BFD_RELOC_HI16, R_M32C_HI16 },
+ { BFD_RELOC_M32C_HI8, R_M32C_HI8 }
};
static reloc_howto_type *
@@ -372,6 +432,11 @@ m32c_elf_relocate_section
}
}
break;
+
+ case R_M32C_HI8:
+ case R_M32C_HI16:
+ relocation >>= 16;
+ break;
}
r = _bfd_final_link_relocate (howto, input_bfd, input_section,