diff options
author | Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com> | 2016-06-20 12:10:53 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2016-06-20 12:16:26 -0700 |
commit | a8ecc9fe61d0fdb1f694c5f3fac910802468d43f (patch) | |
tree | 51bfde2464642854b5c74f29b5f0cb0b392f7df4 /gold/output.cc | |
parent | beceef50438ccf2917744147a4fdadcc84db7d78 (diff) | |
download | gdb-a8ecc9fe61d0fdb1f694c5f3fac910802468d43f.zip gdb-a8ecc9fe61d0fdb1f694c5f3fac910802468d43f.tar.gz gdb-a8ecc9fe61d0fdb1f694c5f3fac910802468d43f.tar.bz2 |
Add support for MIPS .rld_map section.
Includes DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags and
__RLD_MAP symbol.
2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
elfcpp/
* elfcpp.h (DT_MIPS_RLD_MAP_REL): New enum constant.
gold/
* mips.cc (Target_mips::Target_mips): Initialize rld_map_.
(Target_mips::rld_map_): New data member.
(Target_mips::do_finalize_sections): Add support for
DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
.rld_map section, and __RLD_MAP symbol.
(Target_mips::do_dynamic_tag_custom_value): Add support for
DT_MIPS_RLD_MAP_REL dynamic tag.
* output.cc (Output_data_dynamic::get_entry_offset): New method
definition.
* output.h (Output_data_dynamic::get_entry_offset): New method
declaration.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gold/output.cc b/gold/output.cc index 077e2c4..0a9e58f 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1882,6 +1882,27 @@ Output_data_dynamic::do_adjust_output_section(Output_section* os) gold_unreachable(); } +// Get a dynamic entry offset. + +unsigned int +Output_data_dynamic::get_entry_offset(elfcpp::DT tag) const +{ + int dyn_size; + + if (parameters->target().get_size() == 32) + dyn_size = elfcpp::Elf_sizes<32>::dyn_size; + else if (parameters->target().get_size() == 64) + dyn_size = elfcpp::Elf_sizes<64>::dyn_size; + else + gold_unreachable(); + + for (size_t i = 0; i < entries_.size(); ++i) + if (entries_[i].tag() == tag) + return i * dyn_size; + + return -1U; +} + // Set the final data size. void |