Add a test for relocations in non alloc sections.

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

llvm-svn: 265471
This commit is contained in:
Rafael Espindola 2016-04-05 21:27:30 +00:00
parent 818e5f38d2
commit 2d390b6c8b
1 changed files with 25 additions and 0 deletions

View File

@ -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