2010-09-16 17:05:55 +00:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
|
|
|
|
|
|
|
|
// 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
|
|
|
|
.section -.note.GNU,"",@progbits
|
|
|
|
|
2010-10-19 17:39:10 +00:00
|
|
|
// CHECK: ('sh_name', 0x00000012) # '.note.GNU-stack'
|
2010-11-12 15:47:08 +00:00
|
|
|
// CHECK: ('sh_name', 0x00000022) # '.note.GNU-stack2'
|
|
|
|
// CHECK: ('sh_name', 0x00000033) # '.note.GNU-'
|
|
|
|
// CHECK: ('sh_name', 0x0000003e) # '-.note.GNU'
|
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
|
|
|
|
2010-11-12 15:47:08 +00:00
|
|
|
// CHECK: (('sh_name', 0x00000049) # '.init'
|
2010-10-27 18:45:20 +00:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_flags', 0x00000006)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x00000000)
|
2010-11-11 18:13:52 +00:00
|
|
|
// CHECK-NEXT: ('sh_offset', 0x00000050)
|
2010-10-27 18:45:20 +00:00
|
|
|
// CHECK-NEXT: ('sh_size', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x00000000)
|
|
|
|
// CHECK-NEXT: ),
|
2010-11-12 15:47:08 +00:00
|
|
|
// CHECK-NEXT: # Section 0x0000000b
|
|
|
|
// CHECK-NEXT: (('sh_name', 0x0000004f) # '.fini'
|
2010-10-27 18:45:20 +00:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_flags', 0x00000006)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x00000000)
|
2010-11-11 18:13:52 +00:00
|
|
|
// CHECK-NEXT: ('sh_offset', 0x00000050)
|
2010-10-27 18:45:20 +00:00
|
|
|
// CHECK-NEXT: ('sh_size', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x00000000)
|
2010-11-08 02:47:59 +00:00
|
|
|
// CHECK-NEXT: ),
|
2010-11-12 15:47:08 +00:00
|
|
|
// CHECK-NEXT: # Section 0x0000000c
|
|
|
|
// CHECK-NEXT: (('sh_name', 0x00000055) # '.rodata'
|
2010-11-08 02:47:59 +00:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_flags', 0x00000002)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x00000000)
|
2010-11-11 18:13:52 +00:00
|
|
|
// CHECK-NEXT: ('sh_offset', 0x00000050)
|
2010-11-08 02:47:59 +00:00
|
|
|
// CHECK-NEXT: ('sh_size', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x00000000)
|
|
|
|
// CHECK-NEXT: ),
|
2010-11-25 15:32:56 +00:00
|
|
|
// CHECK-NEXT: # Section 0x0000000d
|
|
|
|
// CHECK-NEXT: (('sh_name', 0x0000005d) # 'zed'
|
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_flags', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x00000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x00000000)
|
|
|
|
// CHECK-NEXT: ),
|
2010-10-28 21:33:33 +00:00
|
|
|
|
2010-12-26 21:30:59 +00:00
|
|
|
.section .note.test,"",@note
|
|
|
|
// CHECK: (('sh_name', 0x00000061) # '.note.test'
|
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000007)
|
|
|
|
// CHECK-NEXT: ('sh_flags', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x00000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x00000000)
|
|
|
|
// CHECK-NEXT: ),
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// CHECK: (('sh_name', 0x00000080) # '.eh_frame'
|
|
|
|
// CHECK-NEXT: ('sh_type', 0x70000001)
|
|
|
|
// CHECK-NEXT: ('sh_flags', 0x00000002)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x00000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x00000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x00000000)
|
|
|
|
// CHECK-NEXT: ),
|