diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2013-02-18 23:20:45 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2013-02-18 23:20:45 +0000 |
commit | 5b175e562bea1d0899b2d870715784d09c087f5b (patch) | |
tree | 7b20e641f80f8755390a8916d9e3f592481bd1b0 | |
parent | e8faf7d129cba28000ed252cc078b6c65783447f (diff) | |
download | gdb-5b175e562bea1d0899b2d870715784d09c087f5b.zip gdb-5b175e562bea1d0899b2d870715784d09c087f5b.tar.gz gdb-5b175e562bea1d0899b2d870715784d09c087f5b.tar.bz2 |
* elf64-mips.c (micromips_elf64_howto_table_rel): Add
R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
(micromips_elf64_howto_table_rela): Likewise.
(micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
* elfn32-mips.c (elf_micromips_howto_table_rel): Add
R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
(elf_micromips_howto_table_rela): Likewise.
(micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
-rw-r--r-- | bfd/ChangeLog | 11 | ||||
-rw-r--r-- | bfd/elf64-mips.c | 64 | ||||
-rw-r--r-- | bfd/elfn32-mips.c | 64 |
3 files changed, 139 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0ac30d8..7502b82 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2013-02-18 Maciej W. Rozycki <macro@codesourcery.com> + + * elf64-mips.c (micromips_elf64_howto_table_rel): Add + R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR. + (micromips_elf64_howto_table_rela): Likewise. + (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR. + * elfn32-mips.c (elf_micromips_howto_table_rel): Add + R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR. + (elf_micromips_howto_table_rela): Likewise. + (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR. + 2013-02-18 Paul Brook <paul@codesourcery.com> * elfxx-mips.c (MICROMIPS_P): New macro. diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index f269a21..e9e58df 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -2184,6 +2184,37 @@ static reloc_howto_type micromips_elf64_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* Section displacement. */ + HOWTO (R_MICROMIPS_SCN_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_SCN_DISP", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Protected jump conversion. This is an optimization hint. No + relocation is required for correctness. */ + HOWTO (R_MICROMIPS_JALR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_JALR", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x00000000, /* dst_mask */ + FALSE), /* pcrel_offset */ }; static reloc_howto_type micromips_elf64_howto_table_rela[] = @@ -2495,6 +2526,37 @@ static reloc_howto_type micromips_elf64_howto_table_rela[] = 0, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* Section displacement. */ + HOWTO (R_MICROMIPS_SCN_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_SCN_DISP", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Protected jump conversion. This is an optimization hint. No + relocation is required for correctness. */ + HOWTO (R_MICROMIPS_JALR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_JALR", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x00000000, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* GNU extension to record C++ vtable hierarchy */ @@ -3152,6 +3214,8 @@ static const struct elf_reloc_map micromips_reloc_map[] = { BFD_RELOC_MICROMIPS_HIGHEST, R_MICROMIPS_HIGHEST - R_MICROMIPS_min }, { BFD_RELOC_MICROMIPS_CALL_HI16, R_MICROMIPS_CALL_HI16 - R_MICROMIPS_min }, { BFD_RELOC_MICROMIPS_CALL_LO16, R_MICROMIPS_CALL_LO16 - R_MICROMIPS_min }, + { BFD_RELOC_MICROMIPS_SCN_DISP, R_MICROMIPS_SCN_DISP - R_MICROMIPS_min }, + { BFD_RELOC_MICROMIPS_JALR, R_MICROMIPS_JALR - R_MICROMIPS_min }, }; /* Given a BFD reloc type, return a howto structure. */ diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 08c8e5f..8804900 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -2149,6 +2149,37 @@ static reloc_howto_type elf_micromips_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* Section displacement. */ + HOWTO (R_MICROMIPS_SCN_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_SCN_DISP", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Protected jump conversion. This is an optimization hint. No + relocation is required for correctness. */ + HOWTO (R_MICROMIPS_JALR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_JALR", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x00000000, /* dst_mask */ + FALSE), /* pcrel_offset */ }; static reloc_howto_type elf_micromips_howto_table_rela[] = @@ -2460,6 +2491,37 @@ static reloc_howto_type elf_micromips_howto_table_rela[] = 0, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* Section displacement. */ + HOWTO (R_MICROMIPS_SCN_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_SCN_DISP", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Protected jump conversion. This is an optimization hint. No + relocation is required for correctness. */ + HOWTO (R_MICROMIPS_JALR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MICROMIPS_JALR", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x00000000, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* GNU extension to record C++ vtable hierarchy */ @@ -2967,6 +3029,8 @@ static const struct elf_reloc_map micromips_reloc_map[] = { BFD_RELOC_MICROMIPS_HIGHEST, R_MICROMIPS_HIGHEST - R_MICROMIPS_min }, { BFD_RELOC_MICROMIPS_CALL_HI16, R_MICROMIPS_CALL_HI16 - R_MICROMIPS_min }, { BFD_RELOC_MICROMIPS_CALL_LO16, R_MICROMIPS_CALL_LO16 - R_MICROMIPS_min }, + { BFD_RELOC_MICROMIPS_SCN_DISP, R_MICROMIPS_SCN_DISP - R_MICROMIPS_min }, + { BFD_RELOC_MICROMIPS_JALR, R_MICROMIPS_JALR - R_MICROMIPS_min }, }; /* Given a BFD reloc type, return a howto structure. */ |