[lld] r279476 - Merging r279368:

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 14:15:19 PDT 2016


Author: hans
Date: Mon Aug 22 16:15:19 2016
New Revision: 279476

URL: http://llvm.org/viewvc/llvm-project?rev=279476&view=rev
Log:
Merging r279368:
------------------------------------------------------------------------
r279368 | ed | 2016-08-20 03:54:51 -0700 (Sat, 20 Aug 2016) | 12 lines

Add R_386_TLS_LE as a relocation having an implicit addend.

TLS on i386 in non-PIE/PIC code seems broken right now, because we don't
properly add the addend encoded in the instruction to the resulting
offset when processing R_386_TLS_LE relocations.

Extend one of the existing tests for TLS on i686 to use an addend.

PR:		https://llvm.org/bugs/show_bug.cgi?id=29068
Reviewed by:	ruiu
Differential Revision:	https://reviews.llvm.org/D23741

------------------------------------------------------------------------

Modified:
    lld/branches/release_39/   (props changed)
    lld/branches/release_39/ELF/Target.cpp
    lld/branches/release_39/test/ELF/tls-i686.s

Propchange: lld/branches/release_39/
------------------------------------------------------------------------------
    svn:mergeinfo = /lld/trunk:279368

Modified: lld/branches/release_39/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_39/ELF/Target.cpp?rev=279476&r1=279475&r2=279476&view=diff
==============================================================================
--- lld/branches/release_39/ELF/Target.cpp (original)
+++ lld/branches/release_39/ELF/Target.cpp Mon Aug 22 16:15:19 2016
@@ -436,6 +436,7 @@ uint64_t X86TargetInfo::getImplicitAdden
   case R_386_GOTPC:
   case R_386_PC32:
   case R_386_PLT32:
+  case R_386_TLS_LE:
     return read32le(Buf);
   }
 }

Modified: lld/branches/release_39/test/ELF/tls-i686.s
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_39/test/ELF/tls-i686.s?rev=279476&r1=279475&r2=279476&view=diff
==============================================================================
--- lld/branches/release_39/test/ELF/tls-i686.s (original)
+++ lld/branches/release_39/test/ELF/tls-i686.s Mon Aug 22 16:15:19 2016
@@ -28,7 +28,7 @@ _start:
  movl %gs:0, %ecx
  leal var at ntpoff(%ecx), %eax
  movl %gs:0, %ecx
- leal var1 at ntpoff(%ecx), %eax
+ leal var1 at ntpoff+123(%ecx), %eax
 
 // DIS:      Disassembly of section test:
 // DIS-NEXT: _start:
@@ -41,7 +41,7 @@ _start:
 // DIS-NEXT: 1201c: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx
 // DIS-NEXT: 12023: 8d 81 f8 ff ff ff    leal -8(%ecx), %eax
 // DIS-NEXT: 12029: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx
-// DIS-NEXT: 12030: 8d 81 fc ff ff ff    leal -4(%ecx), %eax
+// DIS-NEXT: 12030: 8d 81 77 00 00 00    leal 119(%ecx), %eax
 
 // RELOC: Relocations [
 // RELOC-NEXT: ]
@@ -57,7 +57,7 @@ _start:
 // DISSHARED-NEXT: 201c: 65 8b 0d 00 00 00 00  movl %gs:0, %ecx
 // DISSHARED-NEXT: 2023: 8d 81 00 00 00 00     leal (%ecx), %eax
 // DISSHARED-NEXT: 2029: 65 8b 0d 00 00 00 00  movl %gs:0, %ecx
-// DISSHARED-NEXT: 2030: 8d 81 00 00 00 00     leal (%ecx), %eax
+// DISSHARED-NEXT: 2030: 8d 81 7b 00 00 00     leal 123(%ecx), %eax
 
 // RELOCSHARED:      Relocations [
 // RELOCSHARED-NEXT: Section (4) .rel.dyn {




More information about the llvm-commits mailing list