From 2d390b6c8b1bdffbe5db91fa8372768415880cb4 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 5 Apr 2016 21:27:30 +0000 Subject: [PATCH] Add a test for relocations in non alloc sections. We already got this right, but we were not testing it. llvm-svn: 265471 --- lld/test/ELF/relocation-non-alloc.s | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lld/test/ELF/relocation-non-alloc.s diff --git a/lld/test/ELF/relocation-non-alloc.s b/lld/test/ELF/relocation-non-alloc.s new file mode 100644 index 000000000000..4ca4183b9c66 --- /dev/null +++ b/lld/test/ELF/relocation-non-alloc.s @@ -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