aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/ELF/section.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/ELF/section.s')
-rw-r--r--test/MC/ELF/section.s51
1 files changed, 50 insertions, 1 deletions
diff --git a/test/MC/ELF/section.s b/test/MC/ELF/section.s
index f3700ca..861dc4f 100644
--- a/test/MC/ELF/section.s
+++ b/test/MC/ELF/section.s
@@ -12,11 +12,12 @@
// CHECK: ('sh_name', 0x00000033) # '.note.GNU-'
// CHECK: ('sh_name', 0x0000003e) # '-.note.GNU'
-// Test that the dafults are used
+// Test that the defaults are used
.section .init
.section .fini
.section .rodata
+.section zed, ""
// CHECK: (('sh_name', 0x00000049) # '.init'
// CHECK-NEXT: ('sh_type', 0x00000001)
@@ -53,9 +54,57 @@
// CHECK-NEXT: ('sh_addralign', 0x00000001)
// CHECK-NEXT: ('sh_entsize', 0x00000000)
// CHECK-NEXT: ),
+// 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: ),
+
+.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: ),
// Test that we can parse these
foo:
bar:
.section .text.foo,"axG",@progbits,foo,comdat
.section .text.bar,"axMG",@progbits,42,bar,comdat
+
+// 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: ),
+
+// Test that we handle the strings like gas
+.section bar-"foo"
+.section "foo"
+
+// CHECK: ('sh_name', 0x0000008a) # 'bar-"foo"'
+// CHECK: ('sh_name', 0x00000094) # 'foo'