[lld] r265471 - Add a test for relocations in non alloc sections.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 14:27:30 PDT 2016


Author: rafael
Date: Tue Apr  5 16:27:30 2016
New Revision: 265471

URL: http://llvm.org/viewvc/llvm-project?rev=265471&view=rev
Log:
Add a test for relocations in non alloc sections.

We already got this right, but we were not testing it.

Added:
    lld/trunk/test/ELF/relocation-non-alloc.s

Added: lld/trunk/test/ELF/relocation-non-alloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation-non-alloc.s?rev=265471&view=auto
==============================================================================
--- lld/trunk/test/ELF/relocation-non-alloc.s (added)
+++ lld/trunk/test/ELF/relocation-non-alloc.s Tue Apr  5 16:27:30 2016
@@ -0,0 +1,25 @@
+// REQUIRES: x86
+
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+// RUN: ld.lld %t -o %t2
+// RUN: llvm-readobj -s -section-data %t2 | FileCheck %s
+
+// CHECK:      Name: foo
+// CHECK-NEXT: Type: SHT_PROGBITS
+// CHECK-NEXT:    Flags [
+// CHECK-NEXT: ]
+// CHECK-NEXT: Address: 0x0
+// CHECK-NEXT: Offset:
+// CHECK-NEXT: Size: 4
+// CHECK-NEXT: Link: 0
+// CHECK-NEXT: Info: 0
+// CHECK-NEXT: AddressAlignment: 1
+// CHECK-NEXT: EntrySize: 0
+// CHECK-NEXT: SectionData (
+// CHECK-NEXT:   0000: 00100100
+// CHECK-NEXT: )
+
+        .global _start
+_start:
+        .section foo
+        .long _start




More information about the llvm-commits mailing list