summaryrefslogtreecommitdiff
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
commit097ac0d8a4a8b35df27299208ff6abeeaa8f4bd8 (patch)
tree800db761b1d52aa78b74d7d668d5b5cf74111f17 /gold/x86_64.cc
parentd5d5e25623d27674ec1cf87fe989aa6cf9af6ae2 (diff)
downloadbinutils-redhat-097ac0d8a4a8b35df27299208ff6abeeaa8f4bd8.tar.gz
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 12a5467f3f..8308bf4ba7 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