From fd54057a29e296d29e662780fc6079e42c742228 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 26 Jul 2005 03:21:53 +0000 Subject: [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. --- bfd/ChangeLog | 11 ++++++++++ bfd/bfd-in2.h | 18 +-------------- bfd/elf32-m32c.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- bfd/libbfd.h | 18 +-------------- bfd/reloc.c | 34 +--------------------------- 5 files changed, 80 insertions(+), 68 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e59ec83..bc71060 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2005-07-25 DJ Delorie + + * 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. + 2005-07-25 Jan Hubicka H.J. Lu diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 7dbfe95..519dce8 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -3077,23 +3077,7 @@ of the container. */ BFD_RELOC_DLX_JMP26, /* Renesas M16C/M32C Relocations. */ - BFD_RELOC_M16C_8_PCREL8, - BFD_RELOC_M16C_16_PCREL8, - BFD_RELOC_M16C_8_PCREL16, - BFD_RELOC_M16C_8_ELABEL24, - BFD_RELOC_M16C_8_ABS16, - BFD_RELOC_M16C_16_ABS16, - BFD_RELOC_M16C_16_ABS24, - BFD_RELOC_M16C_16_ABS32, - BFD_RELOC_M16C_24_ABS16, - BFD_RELOC_M16C_24_ABS24, - BFD_RELOC_M16C_24_ABS32, - BFD_RELOC_M16C_32_ABS16, - BFD_RELOC_M16C_32_ABS24, - BFD_RELOC_M16C_32_ABS32, - BFD_RELOC_M16C_40_ABS16, - BFD_RELOC_M16C_40_ABS24, - BFD_RELOC_M16C_40_ABS32, + BFD_RELOC_M32C_HI8, /* Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit absolute address. */ 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, diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 2a83aae..6e73163 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1338,23 +1338,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_DLX_HI16_S", "BFD_RELOC_DLX_LO16", "BFD_RELOC_DLX_JMP26", - "BFD_RELOC_M16C_8_PCREL8", - "BFD_RELOC_M16C_16_PCREL8", - "BFD_RELOC_M16C_8_PCREL16", - "BFD_RELOC_M16C_8_ELABEL24", - "BFD_RELOC_M16C_8_ABS16", - "BFD_RELOC_M16C_16_ABS16", - "BFD_RELOC_M16C_16_ABS24", - "BFD_RELOC_M16C_16_ABS32", - "BFD_RELOC_M16C_24_ABS16", - "BFD_RELOC_M16C_24_ABS24", - "BFD_RELOC_M16C_24_ABS32", - "BFD_RELOC_M16C_32_ABS16", - "BFD_RELOC_M16C_32_ABS24", - "BFD_RELOC_M16C_32_ABS32", - "BFD_RELOC_M16C_40_ABS16", - "BFD_RELOC_M16C_40_ABS24", - "BFD_RELOC_M16C_40_ABS32", + "BFD_RELOC_M32C_HI8", "BFD_RELOC_M32R_24", "BFD_RELOC_M32R_10_PCREL", "BFD_RELOC_M32R_18_PCREL", diff --git a/bfd/reloc.c b/bfd/reloc.c index fb8a9db..671746f 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -3069,39 +3069,7 @@ ENUMDOC DLX relocs ENUM - BFD_RELOC_M16C_8_PCREL8 -ENUMX - BFD_RELOC_M16C_16_PCREL8 -ENUMX - BFD_RELOC_M16C_8_PCREL16 -ENUMX - BFD_RELOC_M16C_8_ELABEL24 -ENUMX - BFD_RELOC_M16C_8_ABS16 -ENUMX - BFD_RELOC_M16C_16_ABS16 -ENUMX - BFD_RELOC_M16C_16_ABS24 -ENUMX - BFD_RELOC_M16C_16_ABS32 -ENUMX - BFD_RELOC_M16C_24_ABS16 -ENUMX - BFD_RELOC_M16C_24_ABS24 -ENUMX - BFD_RELOC_M16C_24_ABS32 -ENUMX - BFD_RELOC_M16C_32_ABS16 -ENUMX - BFD_RELOC_M16C_32_ABS24 -ENUMX - BFD_RELOC_M16C_32_ABS32 -ENUMX - BFD_RELOC_M16C_40_ABS16 -ENUMX - BFD_RELOC_M16C_40_ABS24 -ENUMX - BFD_RELOC_M16C_40_ABS32 + BFD_RELOC_M32C_HI8 ENUMDOC Renesas M16C/M32C Relocations. -- cgit v1.1