[lld] r273074 - Add a test showing that lto produces relaxable relocations.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 17:36:40 PDT 2016
Author: rafael
Date: Fri Jun 17 19:36:39 2016
New Revision: 273074
URL: http://llvm.org/viewvc/llvm-project?rev=273074&view=rev
Log:
Add a test showing that lto produces relaxable relocations.
Added:
lld/trunk/test/ELF/lto/relax-relocs.ll
Added: lld/trunk/test/ELF/lto/relax-relocs.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/relax-relocs.ll?rev=273074&view=auto
==============================================================================
--- lld/trunk/test/ELF/lto/relax-relocs.ll (added)
+++ lld/trunk/test/ELF/lto/relax-relocs.ll Fri Jun 17 19:36:39 2016
@@ -0,0 +1,15 @@
+; RUN: llvm-as %s -o %t.o
+; RUN: ld.lld -m elf_x86_64 -save-temps -shared %t.o -o %t.so
+; RUN: llvm-readobj -r %t.so.lto.o | FileCheck %s
+
+; Test that we produce R_X86_64_REX_GOTPCRELX instead of R_X86_64_GOTPCREL
+; CHECK: R_X86_64_REX_GOTPCRELX foo
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at foo = external global i32
+define i32 @bar() {
+ %t = load i32, i32* @foo
+ ret i32 %t
+}
More information about the llvm-commits
mailing list