Add a few more cases to this test.

It now documents how we currently handle relocations for
alloc/non-alloc.

llvm-svn: 266141
This commit is contained in:
Rafael Espindola 2016-04-12 22:08:23 +00:00
parent 3774afba07
commit 91641d9947
1 changed files with 36 additions and 7 deletions

View File

@ -1,8 +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
// RUN: ld.lld %t -o %t2 -shared
// RUN: llvm-readobj -s -section-data -r %t2 | FileCheck %s
// CHECK: Name: .text
// CHECK-NEXT: Type: SHT_PROGBITS
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_EXECINSTR
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x1000
// CHECK-NEXT: Offset: 0x1000
// CHECK-NEXT: Size: 16
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 4
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 00100000 00000000 00000000 00000000
// CHECK-NEXT: )
// CHECK: Name: foo
// CHECK-NEXT: Type: SHT_PROGBITS
@ -10,16 +27,28 @@
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x0
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Size: 16
// 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: 0000: 00100000 00000000 00000000 00000000
// CHECK-NEXT: )
.global _start
_start:
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.}}) .rela.dyn {
// CHECK-NEXT: 0x1000 R_X86_64_RELATIVE - 0x1000
// CHECK-NEXT: 0x1008 R_X86_64_64 zed 0x0
// CHECK-NEXT: }
// CHECK-NEXT: ]
.global zed
zed:
bar:
.quad bar
.quad zed
.section foo
.long _start
.quad bar
.quad zed