2013-04-12 12:06:46 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s | FileCheck %s
|
2010-09-17 01:05:55 +08:00
|
|
|
|
|
|
|
// Test that these names are accepted.
|
|
|
|
|
|
|
|
.section .note.GNU-stack,"",@progbits
|
2010-11-12 23:47:08 +08:00
|
|
|
.section .note.GNU-stack2,"",%progbits
|
2010-09-17 01:05:55 +08:00
|
|
|
.section .note.GNU-,"",@progbits
|
2013-09-21 13:25:12 +08:00
|
|
|
.section -.note.GNU,"","progbits"
|
2010-09-17 01:05:55 +08:00
|
|
|
|
2015-05-23 05:37:13 +08:00
|
|
|
// CHECK: Name: .note.GNU-stack
|
|
|
|
// CHECK: Name: .note.GNU-stack2
|
|
|
|
// CHECK: Name: .note.GNU-
|
|
|
|
// CHECK: Name: -.note.GNU
|
2010-10-28 02:45:20 +08:00
|
|
|
|
2010-12-27 05:30:59 +08:00
|
|
|
// Test that the defaults are used
|
2010-10-28 02:45:20 +08:00
|
|
|
|
|
|
|
.section .init
|
|
|
|
.section .fini
|
2010-11-08 10:47:59 +08:00
|
|
|
.section .rodata
|
2010-11-25 23:32:56 +08:00
|
|
|
.section zed, ""
|
2010-10-28 02:45:20 +08:00
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Name: .init
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: SHF_EXECINSTR
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section {
|
2015-04-29 21:55:07 +08:00
|
|
|
// CHECK-NEXT: Index:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Name: .fini
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: SHF_EXECINSTR
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section {
|
2015-04-29 21:55:07 +08:00
|
|
|
// CHECK-NEXT: Index:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Name: .rodata
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section {
|
2015-04-29 21:55:07 +08:00
|
|
|
// CHECK-NEXT: Index:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Name: zed
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
2010-10-29 05:33:33 +08:00
|
|
|
|
2010-12-27 05:30:59 +08:00
|
|
|
.section .note.test,"",@note
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Name: .note.test
|
|
|
|
// CHECK-NEXT: Type: SHT_NOTE
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
2010-12-27 05:30:59 +08:00
|
|
|
|
2010-10-29 05:33:33 +08:00
|
|
|
// Test that we can parse these
|
2010-11-12 02:13:52 +08:00
|
|
|
foo:
|
|
|
|
bar:
|
2010-10-29 05:33:33 +08:00
|
|
|
.section .text.foo,"axG",@progbits,foo,comdat
|
2010-11-12 02:13:52 +08:00
|
|
|
.section .text.bar,"axMG",@progbits,42,bar,comdat
|
2011-01-23 13:43:40 +08:00
|
|
|
|
|
|
|
// Test that the default values are not used
|
|
|
|
|
|
|
|
.section .eh_frame,"a",@unwind
|
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Name: .eh_frame
|
|
|
|
// CHECK-NEXT: Type: SHT_X86_64_UNWIND
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
2011-01-25 02:02:54 +08:00
|
|
|
|
2013-09-16 03:53:20 +08:00
|
|
|
.section .excluded,"e",@progbits
|
|
|
|
|
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Name: .excluded (92)
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS (0x1)
|
|
|
|
// CHECK-NEXT: Flags [ (0x80000000)
|
|
|
|
// CHECK-NEXT: SHF_EXCLUDE (0x80000000)
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-09-16 03:53:20 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
2011-01-25 02:02:54 +08:00
|
|
|
// Test that we handle the strings like gas
|
|
|
|
.section bar-"foo"
|
|
|
|
.section "foo"
|
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
2015-05-23 05:37:13 +08:00
|
|
|
// CHECK: Name: bar-"foo"
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
2015-05-23 05:37:13 +08:00
|
|
|
// CHECK: Name: foo
|