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