From 41e83f2b16ec57fb7e163c19fc315c86e4994b2e Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 29 Oct 2015 08:47:12 -0700 Subject: Make GOT entry size target-dependent The GOT entry size is target-dependent. This patch adds a got_entry_size function to Sized_target class so that a target can provide a value different from default. PR gold/19184 * incremental.cc (Got_plt_view_info): Add got_entry_size. (Local_got_offset_visitor::visit): Replace got_entry_size_ with info_.got_entry_size. (Local_got_offset_visitor::got_entry_size_): Removed. (Global_got_offset_visitor::visit): Replace got_entry_size_ with info_.got_entry_size. (Global_got_offset_visitor::got_entry_size_): Removed. (Output_section_incremental_inputs::write_got_plt): Initialize view_info.got_entry_size. * target.h (Sized_target::got_entry_size): New virtual function. * x86_64.cc (Target_x86_64::got_entry_size): New function. --- gold/target.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gold/target.h') diff --git a/gold/target.h b/gold/target.h index db093b7..b21c56a 100644 --- a/gold/target.h +++ b/gold/target.h @@ -1004,6 +1004,14 @@ class Sized_target : public Target plt_entry_size() const { gold_unreachable(); } + // Return the size of each GOT entry. This is only used for + // laying out the incremental link info sections. A target needs + // to implement this if its GOT size is different. + + virtual unsigned int + got_entry_size() const + { return size / 8; } + // Create the GOT and PLT sections for an incremental update. // A target needs to implement this to support incremental linking. -- cgit v1.1