[lld] r295976 - Add a test showing that nocopyreloc is only about copy relocs.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 06:41:24 PST 2017


Author: rafael
Date: Thu Feb 23 08:41:24 2017
New Revision: 295976

URL: http://llvm.org/viewvc/llvm-project?rev=295976&view=rev
Log:
Add a test showing that nocopyreloc is only about copy relocs.

For functions the linker uses a related hack: creating a plt in the
main executable that preempts the function.

Like bfd and gold, we don't disable it with nocopyreloc.

Modified:
    lld/trunk/test/ELF/undef-with-plt-addr.s

Modified: lld/trunk/test/ELF/undef-with-plt-addr.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/undef-with-plt-addr.s?rev=295976&r1=295975&r2=295976&view=diff
==============================================================================
--- lld/trunk/test/ELF/undef-with-plt-addr.s (original)
+++ lld/trunk/test/ELF/undef-with-plt-addr.s Thu Feb 23 08:41:24 2017
@@ -5,6 +5,9 @@
 // RUN: ld.lld %t.o %t2.so -o %t3
 // RUN: llvm-readobj -t -s -r %t3 | FileCheck %s
 
+// Test that -z nocopyreloc doesn't prevent the plt hack.
+// RUN: ld.lld %t.o %t2.so -o %t3 -z nocopyreloc
+
 .globl _start
 _start:
 movabsq	$set_data, %rax




More information about the llvm-commits mailing list