diff options
Diffstat (limited to 'gold/arm.cc')
-rw-r--r-- | gold/arm.cc | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/gold/arm.cc b/gold/arm.cc index 51ce38c..123f896 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -2342,12 +2342,33 @@ class Target_arm : public Sized_target<32, big_endian> // Return the size of the GOT section. section_size_type - got_size() + got_size() const { gold_assert(this->got_ != NULL); return this->got_->data_size(); } + // Return the number of entries in the GOT. + unsigned int + got_entry_count() const + { + if (!this->has_got_section()) + return 0; + return this->got_size() / 4; + } + + // Return the number of entries in the PLT. + unsigned int + plt_entry_count() const; + + // Return the offset of the first non-reserved PLT entry. + unsigned int + first_plt_entry_offset() const; + + // Return the size of each PLT entry. + unsigned int + plt_entry_size() const; + // Map platform-specific reloc types static unsigned int get_real_reloc_type (unsigned int r_type); @@ -2816,6 +2837,9 @@ class Target_arm : public Sized_target<32, big_endian> static const Target::Target_info arm_info; // The types of GOT entries needed for this platform. + // These values are exposed to the ABI in an incremental link. + // Do not renumber existing values without changing the version + // number of the .gnu_incremental_inputs section. enum Got_type { GOT_TYPE_STANDARD = 0, // GOT entry for a regular symbol @@ -7111,6 +7135,21 @@ class Output_data_plt_arm : public Output_section_data rel_plt() const { return this->rel_; } + // Return the number of PLT entries. + unsigned int + entry_count() const + { return this->count_; } + + // Return the offset of the first non-reserved PLT entry. + static unsigned int + first_plt_entry_offset() + { return sizeof(first_plt_entry); } + + // Return the size of a PLT entry. + static unsigned int + get_plt_entry_size() + { return sizeof(plt_entry); } + protected: void do_adjust_output_section(Output_section* os); @@ -7326,6 +7365,35 @@ Target_arm<big_endian>::make_plt_entry(Symbol_table* symtab, Layout* layout, this->plt_->add_entry(gsym); } +// Return the number of entries in the PLT. + +template<bool big_endian> +unsigned int +Target_arm<big_endian>::plt_entry_count() const +{ + if (this->plt_ == NULL) + return 0; + return this->plt_->entry_count(); +} + +// Return the offset of the first non-reserved PLT entry. + +template<bool big_endian> +unsigned int +Target_arm<big_endian>::first_plt_entry_offset() const +{ + return Output_data_plt_arm<big_endian>::first_plt_entry_offset(); +} + +// Return the size of each PLT entry. + +template<bool big_endian> +unsigned int +Target_arm<big_endian>::plt_entry_size() const +{ + return Output_data_plt_arm<big_endian>::get_plt_entry_size(); +} + // Get the section to use for TLS_DESC relocations. template<bool big_endian> |