[PATCH] D47563: Relax GOTPCREL relocations for tail jmp instructions

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 31 11:16:44 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL333676: Relax GOTPCREL relocations for tail jmp instructions. (authored by tmsriram, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D47563?vs=149213&id=149322#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D47563

Files:
  llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
  llvm/trunk/test/CodeGen/X86/tailjmp_gotpcrel_relax_relocation.ll


Index: llvm/trunk/test/CodeGen/X86/tailjmp_gotpcrel_relax_relocation.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/tailjmp_gotpcrel_relax_relocation.ll
+++ llvm/trunk/test/CodeGen/X86/tailjmp_gotpcrel_relax_relocation.ll
@@ -0,0 +1,15 @@
+; RUN: llc -filetype=obj -relax-elf-relocations=true -mtriple=x86_64-linux-gnu -o - %s |  llvm-objdump - -d -r | FileCheck %s
+
+; CHECK: jmpq *(%rip)
+; CHECK-NEXT: R_X86_64_GOTPCRELX
+
+define i32 @main() {
+entry:
+  %call = tail call i32 @foo()
+  ret i32 %call
+}
+
+; Function Attrs: nonlazybind
+declare i32 @foo() #1
+
+attributes #1 = { nonlazybind }
Index: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
@@ -399,6 +399,7 @@
         return X86::reloc_riprel_4byte_movq_load;
       case X86::CALL64m:
       case X86::JMP64m:
+      case X86::TAILJMPm64:
       case X86::TEST64mr:
       case X86::ADC64rm:
       case X86::ADD64rm:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47563.149322.patch
Type: text/x-patch
Size: 1149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180531/d7d71100/attachment.bin>


More information about the llvm-commits mailing list