2015-08-12 08:00:24 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
2015-11-18 14:11:01 +08:00
|
|
|
// RUN: ld.lld %t -o %t2
|
2015-08-12 08:00:24 +08:00
|
|
|
// RUN: llvm-readobj -sections -section-data %t2 | FileCheck %s
|
|
|
|
// REQUIRES: x86
|
|
|
|
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
|
2015-08-14 01:04:50 +08:00
|
|
|
.section foobar,"",@progbits,unique,1
|
|
|
|
.section foobar,"T",@progbits,unique,2
|
|
|
|
.section foobar,"",@nobits,unique,3
|
|
|
|
.section foobar,"",@nobits,unique,4
|
|
|
|
|
2015-08-13 23:23:46 +08:00
|
|
|
.section bar, "a"
|
2015-08-13 22:45:44 +08:00
|
|
|
|
2015-08-13 23:23:46 +08:00
|
|
|
// Both sections are in the output and that the alloc section is first:
|
|
|
|
// CHECK: Name: bar
|
2015-08-14 01:04:50 +08:00
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: ]
|
2015-11-25 02:48:16 +08:00
|
|
|
// CHECK-NEXT: Address: 0x10120
|
2015-08-13 23:23:46 +08:00
|
|
|
|
|
|
|
// CHECK: Name: foobar
|
2015-08-14 01:04:50 +08:00
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
|
|
|
|
// CHECK: Name: foobar
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_TLS
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
|
|
|
|
// CHECK: Name: foobar
|
|
|
|
// CHECK-NEXT: Type: SHT_NOBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
|
|
|
|
// CHECK-NOT: Name: foobar
|
2015-08-12 08:00:24 +08:00
|
|
|
|
2015-10-05 23:24:04 +08:00
|
|
|
// Test that the string "bar" is merged into "foobar".
|
2015-08-12 08:00:24 +08:00
|
|
|
|
2015-10-21 01:21:35 +08:00
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Index:
|
|
|
|
// CHECK: Name: .shstrtab
|
|
|
|
// CHECK-NEXT: Type: SHT_STRTAB
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
// CHECK-NEXT: Offset:
|
2015-11-04 03:56:47 +08:00
|
|
|
// CHECK-NEXT: Size:
|
2015-10-21 01:21:35 +08:00
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: SectionData (
|
2016-01-07 10:35:32 +08:00
|
|
|
// CHECK-NEXT: 0000: 00626172 002E7465 78740066 6F6F6261 |.bar..text.fooba|
|
2016-01-29 09:24:25 +08:00
|
|
|
// CHECK-NEXT: 0010: 72002E73 796D7461 62002E73 68737472 |r..symtab..shstr|
|
|
|
|
// CHECK-NEXT: 0020: 74616200 2E737472 74616200 |tab..strtab.|
|
2015-10-21 01:21:35 +08:00
|
|
|
// CHECK-NEXT: )
|
|
|
|
// CHECK-NEXT:}
|
2015-08-14 01:04:50 +08:00
|
|
|
// CHECK: Name: .strtab
|
2015-08-12 08:00:24 +08:00
|
|
|
// CHECK-NEXT: Type: SHT_STRTAB (0x3)
|
|
|
|
// CHECK-NEXT: Flags [ (0x0)
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
// CHECK-NEXT: Offset:
|
2015-10-21 01:21:35 +08:00
|
|
|
// CHECK-NEXT: Size: 15
|
2015-08-12 08:00:24 +08:00
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: SectionData (
|
2016-01-07 10:35:32 +08:00
|
|
|
// CHECK-NEXT: 0000: 00666F6F 62617200 5F737461 727400 |.foobar._start.|
|
2015-08-12 08:00:24 +08:00
|
|
|
// CHECK-NEXT: )
|
|
|
|
// CHECK-NEXT: }
|