diff options
author | Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com> | 2016-06-20 11:45:18 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2016-06-20 11:45:18 -0700 |
commit | f5b117594fd27b73be9c1b4bb10e171883783450 (patch) | |
tree | 89f95d02dfa35d398fe0d3cb77b1a6249cb88600 /elfcpp | |
parent | 7dc3990e4002e0062007c1d41b56e04b5b8ec1ec (diff) | |
download | gdb-f5b117594fd27b73be9c1b4bb10e171883783450.zip gdb-f5b117594fd27b73be9c1b4bb10e171883783450.tar.gz gdb-f5b117594fd27b73be9c1b4bb10e171883783450.tar.bz2 |
Add support for Mips32r6 and Mips64r6.
elfcpp/
* mips.h (R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3,
R_MIPS_PC19_S2, R_MIPS_PCHI16, R_MIPS_PCLO16): New enums for
Mips32r6 and Mips64r6 relocations.
(r6_isa): New function.
gold/
* mips.cc (relocation_needs_la25_stub): Add support for relocs:
R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
(hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
(is_matching_lo16_reloc): Likewise.
(lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
(Mips_output_data_plt::plt_entry_r6): New static data member for
R6 PLT entry.
(Target_mips::is_output_r6): New method.
(Target_mips::Mips_mach): Add new enum constants.
(Mips_relocate_functions::Status): Likewise.
(Mips_relocate_functions::pchi16_relocs): New static data member.
(Mips_relocate_functions::relpc21): New method.
(Mips_relocate_functions::relpc26): Likewise.
(Mips_relocate_functions::relpc18): Likewise.
(Mips_relocate_functions::relpc19): Likewise.
(Mips_relocate_functions::relpchi16): Likewise.
(Mips_relocate_functions::do_relpchi16): Likewise.
(Mips_relocate_functions::relpclo16): Likewise.
(Mips_output_data_plt::do_write): Add support for Mips r6 plt
entry.
(Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
(Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
E_MIPS_ARCH_64R6 support.
(Target_mips::update_abiflags_isa): Likewise.
(mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
R_MIPS_PC19_S2.
(Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
and R_MIPS_PCLO16.
(Target_mips::Scan::global): Add support for relocs:
R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
(Target_mips::Relocate::relocate): Call functions for resolving
Mips32r6 and Mips64r6 relocations, and print error message for
STATUS_PCREL_UNALIGNED.
(Target_mips::Scan::get_reference_flags): Add support for relocs:
R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
(Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
E_MIPS_ARCH_64R6 support.
Diffstat (limited to 'elfcpp')
-rw-r--r-- | elfcpp/ChangeLog | 7 | ||||
-rw-r--r-- | elfcpp/mips.h | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/elfcpp/ChangeLog b/elfcpp/ChangeLog index 93b2189..fa8594e 100644 --- a/elfcpp/ChangeLog +++ b/elfcpp/ChangeLog @@ -1,3 +1,10 @@ +2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com> + + * mips.h (R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3, + R_MIPS_PC19_S2, R_MIPS_PCHI16, R_MIPS_PCLO16): New enums for + Mips32r6 and Mips64r6 relocations. + (r6_isa): New function. + 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com> * elfcpp.h (SHT_MIPS_ABIFLAGS): New enum constant. diff --git a/elfcpp/mips.h b/elfcpp/mips.h index a7a9799..f93a18f 100644 --- a/elfcpp/mips.h +++ b/elfcpp/mips.h @@ -98,6 +98,12 @@ enum R_MIPS_TLS_TPREL_HI16 = 49, R_MIPS_TLS_TPREL_LO16 = 50, R_MIPS_GLOB_DAT = 51, + R_MIPS_PC21_S2 = 60, + R_MIPS_PC26_S2 = 61, + R_MIPS_PC18_S3 = 62, + R_MIPS_PC19_S2 = 63, + R_MIPS_PCHI16 = 64, + R_MIPS_PCLO16 = 65, // These relocs are used for the mips16. R_MIPS16_26 = 100, R_MIPS16_GPREL = 101, @@ -479,6 +485,14 @@ bool abi_n32(elfcpp::Elf_Word e_flags) { return (e_flags & elfcpp::EF_MIPS_ABI2) != 0; } +// Whether the ISA is R6. +bool +r6_isa(elfcpp::Elf_Word e_flags) +{ + return ((e_flags & elfcpp::EF_MIPS_ARCH) == elfcpp::E_MIPS_ARCH_32R6) + || ((e_flags & elfcpp::EF_MIPS_ARCH) == elfcpp::E_MIPS_ARCH_64R6); +} + // Whether the file has microMIPS code. bool is_micromips(elfcpp::Elf_Word e_flags) |