[lld] [lld][ELF][X86] Add missing X86_64_TPOFF64 case in switches (PR #77208)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 7 11:30:32 PST 2024


================
@@ -1,14 +1,23 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-cloudabi %s -o %t1.o
 # RUN: ld.lld -pie %t1.o -o %t
-# RUN: llvm-readobj -r %t | FileCheck %s
+# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOCS %s
+# RUN: llvm-objdump -d --no-show-raw-insn --no-print-imm-hex --no-leading-addr %t1.o | FileCheck --check-prefix=DIS %s
 
-# Bug 27174: R_X86_64_TPOFF32 and R_X86_64_GOTTPOFF relocations should
-# be eliminated when building a PIE executable, as the static TLS layout
-# is fixed.
+# Bug 27174: R_X86_64_TPOFF32, R_X86_86_TPOFF64, and R_X86_64_GOTTPOFF
+# relocations should be eliminated when building a PIE executable, as the static
+# TLS layout is fixed.
 #
-# CHECK:      Relocations [
-# CHECK-NEXT: ]
+# RELOCS:      Relocations [
+# RELOCS-NEXT: ]
+#
+# DIS: <_start>:
+# DIS-NEXT:                movq    %fs:0, %rax
+# DIS-NEXT:                movl    $3, (%rax)
+# DIS-NEXT:                movq    %fs:0, %rdx
+# DIS-NEXT:                movq    (%rip), %rcx            # 0x23 <_start+0x23>
----------------
MaskRay wrote:

Drop `# 0x23 <_start+0x23>` so that the test is less sensitive to exact address/offset values.

https://github.com/llvm/llvm-project/pull/77208


More information about the llvm-commits mailing list