aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.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/x86_64.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/x86_64.cc')
-rw-r--r--gold/x86_64.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 12a5467..8308bf4 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -350,6 +350,10 @@ class Target_x86_64 : public Sized_target<64, false>
do_can_check_for_function_pointers() const
{ return !parameters->options().pie(); }
+ // Return the base for a DW_EH_PE_datarel encoding.
+ uint64_t
+ do_ehframe_datarel_base() const;
+
// Adjust -fsplit-stack code which calls non-split-stack code.
void
do_calls_non_split(Relobj* object, unsigned int shndx,
@@ -3640,6 +3644,21 @@ Target_x86_64::do_reloc_addend(void* arg, unsigned int r_type,
return psymval->value(ti.object, 0);
}
+// 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_x86_64::do_ehframe_datarel_base() const
+{
+ gold_assert(this->global_offset_table_ != NULL);
+ Symbol* sym = this->global_offset_table_;
+ Sized_symbol<64>* ssym = static_cast<Sized_symbol<64>*>(sym);
+ return ssym->value();
+}
+
// FNOFFSET in section SHNDX in OBJECT is the start of a function
// compiled with -fsplit-stack. The function calls non-split-stack
// code. We have to change the function so that it always ensures