2010-09-17 01:05:55 +08: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 23:47:08 +08:00
|
|
|
.section .note.GNU-stack2,"",%progbits
|
2010-09-17 01:05:55 +08:00
|
|
|
.section .note.GNU-,"",@progbits
|
|
|
|
.section -.note.GNU,"",@progbits
|
|
|
|
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK: ('sh_name', 0x00000038) # '.note.GNU-stack'
|
|
|
|
// CHECK: ('sh_name', 0x0000008f) # '.note.GNU-stack2'
|
|
|
|
// CHECK: ('sh_name', 0x000000a0) # '.note.GNU-'
|
|
|
|
// CHECK: ('sh_name', 0x00000084) # '-.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
|
|
|
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK: (('sh_name', 0x00000012) # '.init'
|
2010-10-28 02:45:20 +08:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_flags', 0x0000000000000006)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x0000000000000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x0000000000000000)
|
2010-10-28 02:45:20 +08:00
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x0000000000000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
|
2010-10-28 02:45:20 +08:00
|
|
|
// CHECK-NEXT: ),
|
2011-08-04 21:39:15 +08:00
|
|
|
// CHECK-NEXT: # Section 11
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK-NEXT: (('sh_name', 0x00000048) # '.fini'
|
2010-10-28 02:45:20 +08:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_flags', 0x0000000000000006)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x0000000000000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x0000000000000000)
|
2010-10-28 02:45:20 +08:00
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x0000000000000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
|
2010-11-08 10:47:59 +08:00
|
|
|
// CHECK-NEXT: ),
|
2011-08-04 21:39:15 +08:00
|
|
|
// CHECK-NEXT: # Section 12
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK-NEXT: (('sh_name', 0x00000076) # '.rodata'
|
2010-11-08 10:47:59 +08:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_flags', 0x0000000000000002)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x0000000000000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x0000000000000000)
|
2010-11-08 10:47:59 +08:00
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x0000000000000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
|
2010-11-08 10:47:59 +08:00
|
|
|
// CHECK-NEXT: ),
|
2011-08-04 21:39:15 +08:00
|
|
|
// CHECK-NEXT: # Section 13
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK-NEXT: (('sh_name', 0x00000058) # 'zed'
|
2010-11-25 23:32:56 +08:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000001)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_flags', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x0000000000000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x0000000000000000)
|
2010-11-25 23:32:56 +08:00
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x0000000000000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
|
2010-11-25 23:32:56 +08:00
|
|
|
// CHECK-NEXT: ),
|
2010-10-29 05:33:33 +08:00
|
|
|
|
2010-12-27 05:30:59 +08:00
|
|
|
.section .note.test,"",@note
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK: (('sh_name', 0x00000007) # '.note.test'
|
2010-12-27 05:30:59 +08:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x00000007)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_flags', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x0000000000000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x0000000000000000)
|
2010-12-27 05:30:59 +08:00
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x0000000000000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
|
2010-12-27 05:30:59 +08:00
|
|
|
// CHECK-NEXT: ),
|
|
|
|
|
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
|
|
|
|
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK: (('sh_name', 0x0000004e) # '.eh_frame'
|
2011-01-23 13:43:40 +08:00
|
|
|
// CHECK-NEXT: ('sh_type', 0x70000001)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_flags', 0x0000000000000002)
|
|
|
|
// CHECK-NEXT: ('sh_addr', 0x0000000000000000)
|
|
|
|
// CHECK-NEXT: ('sh_offset', 0x0000000000000050)
|
|
|
|
// CHECK-NEXT: ('sh_size', 0x0000000000000000)
|
2011-01-23 13:43:40 +08:00
|
|
|
// CHECK-NEXT: ('sh_link', 0x00000000)
|
|
|
|
// CHECK-NEXT: ('sh_info', 0x00000000)
|
2011-08-05 01:00:11 +08:00
|
|
|
// CHECK-NEXT: ('sh_addralign', 0x0000000000000001)
|
|
|
|
// CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
|
2011-01-23 13:43:40 +08:00
|
|
|
// CHECK-NEXT: ),
|
2011-01-25 02:02:54 +08:00
|
|
|
|
|
|
|
// Test that we handle the strings like gas
|
|
|
|
.section bar-"foo"
|
|
|
|
.section "foo"
|
|
|
|
|
2011-04-08 07:51:25 +08:00
|
|
|
// CHECK: ('sh_name', 0x000000ab) # 'bar-"foo"'
|
|
|
|
// CHECK: ('sh_name', 0x00000034) # 'foo'
|