Handle Initial-Exec to Local-Exec for x32
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 6 Jan 2015 20:58:54 +0000 (12:58 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 6 Jan 2015 20:58:54 +0000 (12:58 -0800)
PR gold/17809
* x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
x32.

gold/ChangeLog
gold/x86_64.cc

index 496d9a79a0cd5b1b61df017c292e8136bb972739..af56066d5a61a3e6ed8036df7a0213550871d314 100644 (file)
@@ -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.
index b45eb3bdf6542a53fdb28455db5722c558444fb9..c368b039869aae87884f39d52dd43d858703d5d5 100644 (file)
@@ -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);
     }