aboutsummaryrefslogtreecommitdiff
path: root/gold/i386.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-07-02 00:03:25 +0000
committerIan Lance Taylor <ian@airs.com>2011-07-02 00:03:25 +0000
commit02d7cd4495b617a9dc356b4f5140a74d020df6f5 (patch)
tree14729ef21007268b56536b188b055be2987a4ca3 /gold/i386.cc
parent3f26b7e8cb3d1e545a1461ded51f24259b1795e7 (diff)
downloadgdb-02d7cd4495b617a9dc356b4f5140a74d020df6f5.zip
gdb-02d7cd4495b617a9dc356b4f5140a74d020df6f5.tar.gz
gdb-02d7cd4495b617a9dc356b4f5140a74d020df6f5.tar.bz2
PR gold/12525
* ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel. Assert if we see DW_EH_PE_indirect. * target.h (Target::ehframe_datarel_base): New function. (Target::do_ehframe_datarel_base): New target function. * i386.cc (Target_i386::do_ehframe_datarel_base): New function. * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New function.
Diffstat (limited to 'gold/i386.cc')
-rw-r--r--gold/i386.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gold/i386.cc b/gold/i386.cc
index 6bec81f..65ff05f 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -295,6 +295,10 @@ class Target_i386 : public Sized_target<32, false>
do_can_check_for_function_pointers() const
{ return true; }
+ // Return the base for a DW_EH_PE_datarel encoding.
+ uint64_t
+ do_ehframe_datarel_base() const;
+
// Return whether SYM is call to a non-split function.
bool
do_is_call_to_non_split(const Symbol* sym, unsigned int) const;
@@ -3267,6 +3271,21 @@ Target_i386::do_code_fill(section_size_type length) const
return std::string(nops[length], length);
}
+// Return the value to use for the base of a DW_EH_PE_datarel offset
+// in an FDE. Solaris and SVR4 use DW_EH_PE_datarel because their
+// assembler can not write out the difference between two labels in
+// different sections, so instead of using a pc-relative value they
+// use an offset from the GOT.
+
+uint64_t
+Target_i386::do_ehframe_datarel_base() const
+{
+ gold_assert(this->global_offset_table_ != NULL);
+ Symbol* sym = this->global_offset_table_;
+ Sized_symbol<32>* ssym = static_cast<Sized_symbol<32>*>(sym);
+ return ssym->value();
+}
+
// Return whether SYM should be treated as a call to a non-split
// function. We don't want that to be true of a call to a
// get_pc_thunk function.