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