[lld] r319565 - Add test for pr35478.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 10:28:13 PST 2017


Author: rafael
Date: Fri Dec  1 10:28:12 2017
New Revision: 319565

URL: http://llvm.org/viewvc/llvm-project?rev=319565&view=rev
Log:
Add test for pr35478.

This would have found the regression in r318924.

Thanks to James Henderson for finding the issue!

Added:
    lld/trunk/test/ELF/relro-non-contiguous-script-data.s

Added: lld/trunk/test/ELF/relro-non-contiguous-script-data.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relro-non-contiguous-script-data.s?rev=319565&view=auto
==============================================================================
--- lld/trunk/test/ELF/relro-non-contiguous-script-data.s (added)
+++ lld/trunk/test/ELF/relro-non-contiguous-script-data.s Fri Dec  1 10:28:12 2017
@@ -0,0 +1,18 @@
+// REQUIRES: x86
+
+// RUN: echo "SECTIONS { \
+// RUN: .dynamic : { *(.dynamic) } \
+// RUN: .non_ro : { . += 1; } \
+// RUN: .jcr : { *(.jcr) } \
+// RUN: } " > %t.script
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+// RUN: not ld.lld --export-dynamic %t.o -o %t --script=%t.script 2>&1 | FileCheck %s
+
+// CHECK: error: section: .jcr is not contiguous with other relro sections
+
+.global _start
+_start:
+
+        // non-empty relro section
+        .section .jcr, "aw", @progbits
+        .quad 0




More information about the llvm-commits mailing list