2016-04-06 05:27:30 +08:00
|
|
|
// REQUIRES: x86
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
2016-04-13 06:08:23 +08:00
|
|
|
// RUN: ld.lld %t -o %t2 -shared
|
|
|
|
// RUN: llvm-readobj -s -section-data -r %t2 | FileCheck %s
|
|
|
|
|
2016-04-30 08:49:10 +08:00
|
|
|
// CHECK: Name: .data
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
2016-04-30 08:49:10 +08:00
|
|
|
// CHECK-NEXT: SHF_WRITE
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK-NEXT: ]
|
2017-01-10 09:21:30 +08:00
|
|
|
// CHECK-NEXT: Address: 0x1000
|
|
|
|
// CHECK-NEXT: Offset: 0x1000
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK-NEXT: Size: 16
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
2016-04-30 08:49:10 +08:00
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: SectionData (
|
2016-05-13 22:15:37 +08:00
|
|
|
// CHECK-NEXT: 0000: 00000000 00000000 00000000 00000000
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK-NEXT: )
|
2016-04-06 05:27:30 +08:00
|
|
|
|
|
|
|
// CHECK: Name: foo
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
// CHECK-NEXT: Offset:
|
2016-04-29 11:21:08 +08:00
|
|
|
// CHECK-NEXT: Size: 32
|
2016-04-06 05:27:30 +08:00
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: SectionData (
|
2017-01-10 09:21:30 +08:00
|
|
|
// CHECK-NEXT: 0000: 00100000 00000000 00100000 00000000
|
|
|
|
// CHECK-NEXT: 0010: 00100000 00000000 00100000 00000000
|
2016-04-06 05:27:30 +08:00
|
|
|
// CHECK-NEXT: )
|
|
|
|
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section ({{.}}) .rela.dyn {
|
2017-01-10 09:21:30 +08:00
|
|
|
// CHECK-NEXT: 0x1000 R_X86_64_RELATIVE - 0x1000
|
|
|
|
// CHECK-NEXT: 0x1008 R_X86_64_64 zed 0x0
|
2016-04-13 06:08:23 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
|
2016-04-30 08:49:10 +08:00
|
|
|
.data
|
2016-04-13 06:08:23 +08:00
|
|
|
.global zed
|
|
|
|
zed:
|
|
|
|
bar:
|
|
|
|
.quad bar
|
|
|
|
.quad zed
|
|
|
|
|
2016-04-06 05:27:30 +08:00
|
|
|
.section foo
|
2016-04-13 06:08:23 +08:00
|
|
|
.quad bar
|
|
|
|
.quad zed
|
2016-04-29 11:21:08 +08:00
|
|
|
|
|
|
|
.section foo
|
|
|
|
.quad bar
|
|
|
|
.quad zed
|