This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Handle Initial-Exec to Local-Exec for x32
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Cc: Cary Coutant <ccoutant at google dot com>
- Date: Tue, 6 Jan 2015 13:00:52 -0800
- Subject: [PATCH] Handle Initial-Exec to Local-Exec for x32
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch handls Handle Initial-Exec to Local-Exec for x32. OK
to install?
Thanks.
H.J.
---
PR gold/17809
* x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
x32.
---
gold/ChangeLog | 6 ++++++
gold/x86_64.cc | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 496d9a7..af56066 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/17809
+ * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
+ x32.
+
2015-01-02 Alan Modra <amodra@gmail.com>
* version.cc (print_version): Just print current year.
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index b45eb3b..c368b03 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -4100,6 +4100,8 @@ Target_x86_64<size>::Relocate::tls_ie_to_le(
// movq
if (op1 == 0x4c)
view[-3] = 0x49;
+ else if (size == 32 && op1 == 0x44)
+ view[-3] = 0x41;
view[-2] = 0xc7;
view[-1] = 0xc0 | reg;
}
@@ -4108,6 +4110,8 @@ Target_x86_64<size>::Relocate::tls_ie_to_le(
// Special handling for %rsp.
if (op1 == 0x4c)
view[-3] = 0x49;
+ else if (size == 32 && op1 == 0x44)
+ view[-3] = 0x41;
view[-2] = 0x81;
view[-1] = 0xc0 | reg;
}
@@ -4116,6 +4120,8 @@ Target_x86_64<size>::Relocate::tls_ie_to_le(
// addq
if (op1 == 0x4c)
view[-3] = 0x4d;
+ else if (size == 32 && op1 == 0x44)
+ view[-3] = 0x45;
view[-2] = 0x8d;
view[-1] = 0x80 | reg | (reg << 3);
}
--
1.9.3