aboutsummaryrefslogtreecommitdiff
path: root/gold/ehframe.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/ehframe.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/ehframe.cc')
-rw-r--r--gold/ehframe.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gold/ehframe.cc b/gold/ehframe.cc
index 80b0035..dad2331 100644
--- a/gold/ehframe.cc
+++ b/gold/ehframe.cc
@@ -266,7 +266,7 @@ Eh_frame_hdr::get_fde_pc(
gold_unreachable();
}
- switch (fde_encoding & 0xf0)
+ switch (fde_encoding & 0x70)
{
case 0:
break;
@@ -275,12 +275,18 @@ Eh_frame_hdr::get_fde_pc(
pc += eh_frame_address + fde_offset + 8;
break;
+ case elfcpp::DW_EH_PE_datarel:
+ pc += parameters->target().ehframe_datarel_base();
+ break;
+
default:
// If other cases arise, then we have to handle them, or we have
// to reject them by returning false in Eh_frame::read_cie.
gold_unreachable();
}
+ gold_assert((fde_encoding & elfcpp::DW_EH_PE_indirect) == 0);
+
return pc;
}