From d6d640ebae65d7a9f556f3a957a7b36d025dd16f Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 19 Feb 2020 21:27:13 -0800 Subject: [PATCH] [ELF][test] Fix section sh_type and sh_flags A future MC change may add a warning/error when a .section directive specifies incorrect sh_flags/sh_type. --- lld/test/ELF/Inputs/eh-frame-end.s | 2 -- lld/test/ELF/Inputs/eh-frame-pcrel-overflow.s | 2 +- lld/test/ELF/Inputs/mips-nonalloc.s | 2 -- lld/test/ELF/Inputs/ppc64-sort-small-cm-relocs-input4.s | 2 +- lld/test/ELF/comdat-discarded-reloc.s | 2 +- lld/test/ELF/compress-debug-sections-reloc.s | 2 +- lld/test/ELF/eh-frame-begin-end.s | 5 +++-- lld/test/ELF/eh-frame-marker.s | 2 +- lld/test/ELF/eh-frame-negative-pcrel-sdata2.s | 2 +- lld/test/ELF/eh-frame-negative-pcrel-sdata4.s | 2 +- lld/test/ELF/eh-frame-negative-pcrel-sdata8.s | 2 +- lld/test/ELF/eh-frame-pcrel-overflow.s | 2 +- lld/test/ELF/eh-frame-value-format1.s | 2 +- lld/test/ELF/eh-frame-value-format2.s | 2 +- lld/test/ELF/eh-frame-value-format3.s | 2 +- lld/test/ELF/eh-frame-value-format4.s | 2 +- lld/test/ELF/eh-frame-value-format5.s | 2 +- lld/test/ELF/eh-frame-value-format6.s | 2 +- lld/test/ELF/eh-frame-value-format7.s | 2 +- lld/test/ELF/eh-frame-value-format8.s | 2 +- lld/test/ELF/eh-frame-value-format9.s | 2 +- lld/test/ELF/ehframe-relocation.s | 2 +- lld/test/ELF/icf16.s | 2 +- lld/test/ELF/invalid-cie-length.s | 2 +- lld/test/ELF/invalid-cie-length2.s | 2 +- lld/test/ELF/invalid-cie-length3.s | 2 +- lld/test/ELF/invalid-cie-length4.s | 2 +- lld/test/ELF/invalid-cie-length5.s | 2 +- lld/test/ELF/invalid-cie-reference.s | 2 +- lld/test/ELF/invalid-eh-frame.s | 2 +- lld/test/ELF/invalid-eh-frame2.s | 2 +- lld/test/ELF/invalid-eh-frame3.s | 2 +- lld/test/ELF/invalid-eh-frame4.s | 2 +- lld/test/ELF/invalid-eh-frame5.s | 2 +- lld/test/ELF/invalid-eh-frame6.s | 2 +- lld/test/ELF/invalid-eh-frame7.s | 2 +- lld/test/ELF/invalid-eh-frame8.s | 2 +- lld/test/ELF/invalid-eh-frame9.s | 2 +- lld/test/ELF/invalid-fde-rel.s | 2 +- lld/test/ELF/invalid/eh-frame-hdr-no-out.s | 2 +- lld/test/ELF/linkerscript/Inputs/compress-debug-sections.s | 2 +- lld/test/ELF/linkerscript/compress-debug-sections-custom.s | 2 +- lld/test/ELF/linkerscript/compress-debug-sections.s | 2 +- lld/test/ELF/mips-micro-relocs.s | 2 +- lld/test/ELF/mips-nonalloc.s | 6 +++--- lld/test/ELF/no-augmentation.s | 2 +- lld/test/ELF/ppc64-ld-got-dtprel.s | 2 +- 47 files changed, 49 insertions(+), 52 deletions(-) delete mode 100644 lld/test/ELF/Inputs/eh-frame-end.s delete mode 100644 lld/test/ELF/Inputs/mips-nonalloc.s diff --git a/lld/test/ELF/Inputs/eh-frame-end.s b/lld/test/ELF/Inputs/eh-frame-end.s deleted file mode 100644 index b7334d8ffbbf..000000000000 --- a/lld/test/ELF/Inputs/eh-frame-end.s +++ /dev/null @@ -1,2 +0,0 @@ - .section ".eh_frame", "a", @progbits - .long 0 diff --git a/lld/test/ELF/Inputs/eh-frame-pcrel-overflow.s b/lld/test/ELF/Inputs/eh-frame-pcrel-overflow.s index 7b3cff88b466..5ffdfee3a60c 100644 --- a/lld/test/ELF/Inputs/eh-frame-pcrel-overflow.s +++ b/lld/test/ELF/Inputs/eh-frame-pcrel-overflow.s @@ -3,7 +3,7 @@ foo: ret -.section .eh_frame, "a" +.section .eh_frame,"a",@unwind .long 12 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/Inputs/mips-nonalloc.s b/lld/test/ELF/Inputs/mips-nonalloc.s deleted file mode 100644 index 72bfd274335c..000000000000 --- a/lld/test/ELF/Inputs/mips-nonalloc.s +++ /dev/null @@ -1,2 +0,0 @@ - .section .debug_info - .word __start diff --git a/lld/test/ELF/Inputs/ppc64-sort-small-cm-relocs-input4.s b/lld/test/ELF/Inputs/ppc64-sort-small-cm-relocs-input4.s index 90f6e0fd6cf3..36cb950d9842 100644 --- a/lld/test/ELF/Inputs/ppc64-sort-small-cm-relocs-input4.s +++ b/lld/test/ELF/Inputs/ppc64-sort-small-cm-relocs-input4.s @@ -10,7 +10,7 @@ getRodata: lwa 3, .LC0@toc(2) blr - .section .rodata,"aMS",@progbits,8 + .section .rodata,"a",@progbits .quad _start .section .toc,"aw",@progbits diff --git a/lld/test/ELF/comdat-discarded-reloc.s b/lld/test/ELF/comdat-discarded-reloc.s index 4d50ab10e512..11252bf1516b 100644 --- a/lld/test/ELF/comdat-discarded-reloc.s +++ b/lld/test/ELF/comdat-discarded-reloc.s @@ -32,7 +32,7 @@ bar: .quad .text.bar1 ## Don't warn on .eh_frame, .debug*, .zdebug*, or .gcc_except_table -.section .eh_frame,"a" +.section .eh_frame,"a",@unwind .quad .text.bar1 .section .debug_foo diff --git a/lld/test/ELF/compress-debug-sections-reloc.s b/lld/test/ELF/compress-debug-sections-reloc.s index b4ee4ea6dd97..e8e3dadcf222 100644 --- a/lld/test/ELF/compress-debug-sections-reloc.s +++ b/lld/test/ELF/compress-debug-sections-reloc.s @@ -17,7 +17,7 @@ a_sym: nop -.section .debug_str,"",@progbits +.section .debug_str,"MS",@progbits,1 .long a_sym .long a_debug_sym diff --git a/lld/test/ELF/eh-frame-begin-end.s b/lld/test/ELF/eh-frame-begin-end.s index 9ec2f6e8c4b4..46816054f2dc 100644 --- a/lld/test/ELF/eh-frame-begin-end.s +++ b/lld/test/ELF/eh-frame-begin-end.s @@ -1,6 +1,7 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=amd64-unknown-openbsd %s -o %t.o -// RUN: llvm-mc -filetype=obj -triple=amd64-unknown-openbsd %p/Inputs/eh-frame-end.s -o %t2.o +// RUN: echo '.section .eh_frame,"a",@unwind; .long 0' | \ +// RUN: llvm-mc -filetype=obj -triple=amd64-unknown-openbsd - -o %t2.o // RUN: ld.lld %t.o %t2.o -o %t // RUN: llvm-readobj --sections %t | FileCheck %s @@ -13,5 +14,5 @@ // CHECK-NEXT: Offset: 0x120 // CHECK-NEXT: Size: 4 - .section ".eh_frame", "a", @progbits +.section .eh_frame,"a",@unwind __EH_FRAME_BEGIN__: diff --git a/lld/test/ELF/eh-frame-marker.s b/lld/test/ELF/eh-frame-marker.s index 7a03cf7ff519..02591ed21cb7 100644 --- a/lld/test/ELF/eh-frame-marker.s +++ b/lld/test/ELF/eh-frame-marker.s @@ -15,6 +15,6 @@ // CHECK: Name: foo // CHECK-NEXT: Value: [[ADDR]] - .section .eh_frame + .section .eh_frame,"a",@unwind foo: .long 0 diff --git a/lld/test/ELF/eh-frame-negative-pcrel-sdata2.s b/lld/test/ELF/eh-frame-negative-pcrel-sdata2.s index f2db28d9ce3f..dc78953ea4ff 100644 --- a/lld/test/ELF/eh-frame-negative-pcrel-sdata2.s +++ b/lld/test/ELF/eh-frame-negative-pcrel-sdata2.s @@ -57,7 +57,7 @@ _start: nop -.section .eh_frame, "a" +.section .eh_frame,"a",@unwind .long 16 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/eh-frame-negative-pcrel-sdata4.s b/lld/test/ELF/eh-frame-negative-pcrel-sdata4.s index b48f9247576a..b9cd45323451 100644 --- a/lld/test/ELF/eh-frame-negative-pcrel-sdata4.s +++ b/lld/test/ELF/eh-frame-negative-pcrel-sdata4.s @@ -57,7 +57,7 @@ _start: nop -.section .eh_frame, "a" +.section .eh_frame,"a",@unwind .long 16 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/eh-frame-negative-pcrel-sdata8.s b/lld/test/ELF/eh-frame-negative-pcrel-sdata8.s index 283f722be84c..887a27ad0f55 100644 --- a/lld/test/ELF/eh-frame-negative-pcrel-sdata8.s +++ b/lld/test/ELF/eh-frame-negative-pcrel-sdata8.s @@ -57,7 +57,7 @@ _start: nop -.section .eh_frame, "a" +.section .eh_frame,"a",@unwind .long 16 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/eh-frame-pcrel-overflow.s b/lld/test/ELF/eh-frame-pcrel-overflow.s index 676a3dea17a9..78e804768dad 100644 --- a/lld/test/ELF/eh-frame-pcrel-overflow.s +++ b/lld/test/ELF/eh-frame-pcrel-overflow.s @@ -11,7 +11,7 @@ _start: ret -.section .eh_frame, "a" +.section .eh_frame,"a",@unwind .long 12 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/eh-frame-value-format1.s b/lld/test/ELF/eh-frame-value-format1.s index a8bcffb4fe4f..da078eb79b42 100644 --- a/lld/test/ELF/eh-frame-value-format1.s +++ b/lld/test/ELF/eh-frame-value-format1.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t # RUN: ld.lld --eh-frame-hdr %t -o /dev/null -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x14 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/eh-frame-value-format2.s b/lld/test/ELF/eh-frame-value-format2.s index 6d2d82e267c7..1c907501ead3 100644 --- a/lld/test/ELF/eh-frame-value-format2.s +++ b/lld/test/ELF/eh-frame-value-format2.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t # RUN: ld.lld --eh-frame-hdr %t -o /dev/null -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x14 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/eh-frame-value-format3.s b/lld/test/ELF/eh-frame-value-format3.s index 1f174ae60a0d..46e8db90ec18 100644 --- a/lld/test/ELF/eh-frame-value-format3.s +++ b/lld/test/ELF/eh-frame-value-format3.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t # RUN: ld.lld --eh-frame-hdr %t -o /dev/null -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/eh-frame-value-format4.s b/lld/test/ELF/eh-frame-value-format4.s index d10988a4fc86..e3e516d4eed2 100644 --- a/lld/test/ELF/eh-frame-value-format4.s +++ b/lld/test/ELF/eh-frame-value-format4.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t # RUN: ld.lld --eh-frame-hdr %t -o /dev/null -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/eh-frame-value-format5.s b/lld/test/ELF/eh-frame-value-format5.s index fd5b35a8b05e..cfa23723ea29 100644 --- a/lld/test/ELF/eh-frame-value-format5.s +++ b/lld/test/ELF/eh-frame-value-format5.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t # RUN: ld.lld --eh-frame-hdr %t -o /dev/null -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x14 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/eh-frame-value-format6.s b/lld/test/ELF/eh-frame-value-format6.s index ee76fa7a050f..23093b204c50 100644 --- a/lld/test/ELF/eh-frame-value-format6.s +++ b/lld/test/ELF/eh-frame-value-format6.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t # RUN: ld.lld --eh-frame-hdr %t -o /dev/null -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x14 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/eh-frame-value-format7.s b/lld/test/ELF/eh-frame-value-format7.s index 038ed12a05b1..5ebd5af44bed 100644 --- a/lld/test/ELF/eh-frame-value-format7.s +++ b/lld/test/ELF/eh-frame-value-format7.s @@ -53,7 +53,7 @@ foo: nop -.section .eh_frame +.section .eh_frame,"a",@unwind .long 12 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/eh-frame-value-format8.s b/lld/test/ELF/eh-frame-value-format8.s index 155e81a2c5f6..6d5da05c2bfa 100644 --- a/lld/test/ELF/eh-frame-value-format8.s +++ b/lld/test/ELF/eh-frame-value-format8.s @@ -52,7 +52,7 @@ foo: nop -.section .eh_frame, "ax" +.section .eh_frame,"a",@unwind .long 12 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/eh-frame-value-format9.s b/lld/test/ELF/eh-frame-value-format9.s index 11c4789bc3e1..1c5ca3bbafd7 100644 --- a/lld/test/ELF/eh-frame-value-format9.s +++ b/lld/test/ELF/eh-frame-value-format9.s @@ -4,7 +4,7 @@ # RUN: not ld.lld --eh-frame-hdr %t.o -o /dev/null 2>&1 | FileCheck %s # CHECK: error: unknown FDE size encoding -.section .eh_frame, "ax" +.section .eh_frame,"a",@unwind .long 12 # Size .long 0x00 # ID .byte 0x01 # Version. diff --git a/lld/test/ELF/ehframe-relocation.s b/lld/test/ELF/ehframe-relocation.s index 953d53eca5a3..2bfb2a7b3550 100644 --- a/lld/test/ELF/ehframe-relocation.s +++ b/lld/test/ELF/ehframe-relocation.s @@ -23,7 +23,7 @@ // DISASM-NEXT: 201154: {{.*}} movq 2097440, %rax // DISASM-NEXT: 20115c: {{.*}} movq 2097445, %rax -.section .eh_frame,"ax",@unwind +.section .eh_frame,"a",@unwind .section .text .globl _start diff --git a/lld/test/ELF/icf16.s b/lld/test/ELF/icf16.s index 13cb8ecd2994..047acdcfc1f3 100644 --- a/lld/test/ELF/icf16.s +++ b/lld/test/ELF/icf16.s @@ -9,7 +9,7 @@ # CHECK-NOT: selected -.section ".eh_frame", "a", @progbits +.section ".eh_frame", "a", @unwind .globl foo foo: .quad 0 diff --git a/lld/test/ELF/invalid-cie-length.s b/lld/test/ELF/invalid-cie-length.s index 7e73dd8aa5d3..d5465e854409 100644 --- a/lld/test/ELF/invalid-cie-length.s +++ b/lld/test/ELF/invalid-cie-length.s @@ -3,7 +3,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0 // CHECK: error: corrupted .eh_frame: CIE/FDE too small diff --git a/lld/test/ELF/invalid-cie-length2.s b/lld/test/ELF/invalid-cie-length2.s index a43491c17790..c423e24d2834 100644 --- a/lld/test/ELF/invalid-cie-length2.s +++ b/lld/test/ELF/invalid-cie-length2.s @@ -3,7 +3,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s -.section .eh_frame +.section .eh_frame,"a",@unwind .long 42 // CHECK: error: corrupted .eh_frame: CIE/FDE ends past the end of the section diff --git a/lld/test/ELF/invalid-cie-length3.s b/lld/test/ELF/invalid-cie-length3.s index 3417efcba8fa..8f2055f9d503 100644 --- a/lld/test/ELF/invalid-cie-length3.s +++ b/lld/test/ELF/invalid-cie-length3.s @@ -3,7 +3,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s -.section .eh_frame +.section .eh_frame,"a",@unwind .long 0xFFFFFFFC // CHECK: error: corrupted .eh_frame: CIE/FDE ends past the end of the section diff --git a/lld/test/ELF/invalid-cie-length4.s b/lld/test/ELF/invalid-cie-length4.s index cf3a6f513747..b2ad8a46af7a 100644 --- a/lld/test/ELF/invalid-cie-length4.s +++ b/lld/test/ELF/invalid-cie-length4.s @@ -3,7 +3,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s -.section .eh_frame +.section .eh_frame,"a",@unwind .long 0xFFFFFFFF .byte 0 diff --git a/lld/test/ELF/invalid-cie-length5.s b/lld/test/ELF/invalid-cie-length5.s index 223ce125853b..9b9b2d8db9c1 100644 --- a/lld/test/ELF/invalid-cie-length5.s +++ b/lld/test/ELF/invalid-cie-length5.s @@ -3,7 +3,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s - .section .eh_frame + .section .eh_frame,"a",@unwind .long 0xFFFFFFFF .quad 0xFFFFFFFFFFFFFFF4 diff --git a/lld/test/ELF/invalid-cie-reference.s b/lld/test/ELF/invalid-cie-reference.s index 0f64c4a429b4..158fc4e935f2 100644 --- a/lld/test/ELF/invalid-cie-reference.s +++ b/lld/test/ELF/invalid-cie-reference.s @@ -3,7 +3,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s - .section .eh_frame + .section .eh_frame,"a",@unwind .long 0x14 .long 0x0 .byte 0x01 diff --git a/lld/test/ELF/invalid-eh-frame.s b/lld/test/ELF/invalid-eh-frame.s index 533442872346..ccf433c6a675 100644 --- a/lld/test/ELF/invalid-eh-frame.s +++ b/lld/test/ELF/invalid-eh-frame.s @@ -6,7 +6,7 @@ # CHECK: error: corrupted .eh_frame: unexpected end of CIE # CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0x8) -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x04 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame2.s b/lld/test/ELF/invalid-eh-frame2.s index c8995cbe1c81..87ce8ede7250 100644 --- a/lld/test/ELF/invalid-eh-frame2.s +++ b/lld/test/ELF/invalid-eh-frame2.s @@ -6,7 +6,7 @@ # CHECK: error: corrupted .eh_frame: corrupted CIE (failed to read string) # CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0x9) -.section .eh_frame +.section .eh_frame,"a",@unwind .align 1 .byte 0x08 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame3.s b/lld/test/ELF/invalid-eh-frame3.s index 44592cbe3c89..7cc27fc42229 100644 --- a/lld/test/ELF/invalid-eh-frame3.s +++ b/lld/test/ELF/invalid-eh-frame3.s @@ -6,7 +6,7 @@ # CHECK: error: corrupted .eh_frame: corrupted CIE (failed to read LEB128) # CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0xC) -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x08 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame4.s b/lld/test/ELF/invalid-eh-frame4.s index 4022c04476dc..a567bd40d73e 100644 --- a/lld/test/ELF/invalid-eh-frame4.s +++ b/lld/test/ELF/invalid-eh-frame4.s @@ -5,7 +5,7 @@ # CHECK: corrupted .eh_frame: unknown .eh_frame augmentation string: -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame5.s b/lld/test/ELF/invalid-eh-frame5.s index eb153fa92c49..798e6c0af934 100644 --- a/lld/test/ELF/invalid-eh-frame5.s +++ b/lld/test/ELF/invalid-eh-frame5.s @@ -5,7 +5,7 @@ # CHECK: corrupted .eh_frame: unknown .eh_frame augmentation string: -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame6.s b/lld/test/ELF/invalid-eh-frame6.s index 9b6b7f8bf87a..68b79c725d0c 100644 --- a/lld/test/ELF/invalid-eh-frame6.s +++ b/lld/test/ELF/invalid-eh-frame6.s @@ -6,7 +6,7 @@ # CHECK: error: corrupted .eh_frame: unknown FDE encoding # CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0xE) -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame7.s b/lld/test/ELF/invalid-eh-frame7.s index 81a0014049e0..6955d51e7aef 100644 --- a/lld/test/ELF/invalid-eh-frame7.s +++ b/lld/test/ELF/invalid-eh-frame7.s @@ -5,7 +5,7 @@ # CHECK: error: corrupted .eh_frame: DW_EH_PE_aligned encoding is not supported -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame8.s b/lld/test/ELF/invalid-eh-frame8.s index 484fef29f8b3..856fddb19c02 100644 --- a/lld/test/ELF/invalid-eh-frame8.s +++ b/lld/test/ELF/invalid-eh-frame8.s @@ -5,7 +5,7 @@ # CHECK: error: corrupted .eh_frame: corrupted CIE -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x0E .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-eh-frame9.s b/lld/test/ELF/invalid-eh-frame9.s index 73a102b4f90d..436b34bb3a80 100644 --- a/lld/test/ELF/invalid-eh-frame9.s +++ b/lld/test/ELF/invalid-eh-frame9.s @@ -5,7 +5,7 @@ # CHECK: error: corrupted .eh_frame: CIE is too small -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x03 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/invalid-fde-rel.s b/lld/test/ELF/invalid-fde-rel.s index f6513225b533..6301ccde98b7 100644 --- a/lld/test/ELF/invalid-fde-rel.s +++ b/lld/test/ELF/invalid-fde-rel.s @@ -7,7 +7,7 @@ // This resembles what gold -r produces when it discards the section // the fde points to. - .section .eh_frame + .section .eh_frame,"a",@unwind .long 0x14 .long 0x0 .byte 0x01 diff --git a/lld/test/ELF/invalid/eh-frame-hdr-no-out.s b/lld/test/ELF/invalid/eh-frame-hdr-no-out.s index 221ca205e591..e878189715fe 100644 --- a/lld/test/ELF/invalid/eh-frame-hdr-no-out.s +++ b/lld/test/ELF/invalid/eh-frame-hdr-no-out.s @@ -4,7 +4,7 @@ // CHECK: error: corrupted .eh_frame: FDE version 1 or 3 expected, but got 2 -.section .eh_frame +.section .eh_frame,"a",@unwind .byte 0x08 .byte 0x00 .byte 0x00 diff --git a/lld/test/ELF/linkerscript/Inputs/compress-debug-sections.s b/lld/test/ELF/linkerscript/Inputs/compress-debug-sections.s index 703be5949e0d..a294fe5f253b 100644 --- a/lld/test/ELF/linkerscript/Inputs/compress-debug-sections.s +++ b/lld/test/ELF/linkerscript/Inputs/compress-debug-sections.s @@ -1,3 +1,3 @@ -.section .debug_str +.section .debug_str,"MS",@progbits,1 .asciz "CCC" .asciz "DDD" diff --git a/lld/test/ELF/linkerscript/compress-debug-sections-custom.s b/lld/test/ELF/linkerscript/compress-debug-sections-custom.s index 31fdd56381b0..f61d6398b1f0 100644 --- a/lld/test/ELF/linkerscript/compress-debug-sections-custom.s +++ b/lld/test/ELF/linkerscript/compress-debug-sections-custom.s @@ -26,7 +26,7 @@ a_sym: nop -.section .debug_str,"",@progbits +.section .debug_str,"MS",@progbits,1 .long a_sym .long a_debug_sym diff --git a/lld/test/ELF/linkerscript/compress-debug-sections.s b/lld/test/ELF/linkerscript/compress-debug-sections.s index 305ff830f2cf..fe1c66dbdbdc 100644 --- a/lld/test/ELF/linkerscript/compress-debug-sections.s +++ b/lld/test/ELF/linkerscript/compress-debug-sections.s @@ -31,6 +31,6 @@ # ZLIBFLAGS-NEXT: Flags [ # ZLIBFLAGS-NEXT: SHF_COMPRESSED -.section .debug_str +.section .debug_str,"MS",@progbits,1 .asciz "AAA" .asciz "BBB" diff --git a/lld/test/ELF/mips-micro-relocs.s b/lld/test/ELF/mips-micro-relocs.s index 0902f10f8f8f..3eb1c1ac7852 100644 --- a/lld/test/ELF/mips-micro-relocs.s +++ b/lld/test/ELF/mips-micro-relocs.s @@ -71,5 +71,5 @@ __start: .data .gpword __start # R_MIPS_GPREL32 - .section .debug_info + .section .debug_info,"",@0x7000001e .word __start # R_MIPS_32 diff --git a/lld/test/ELF/mips-nonalloc.s b/lld/test/ELF/mips-nonalloc.s index 5ec308d9e662..b1fa4991d4d2 100644 --- a/lld/test/ELF/mips-nonalloc.s +++ b/lld/test/ELF/mips-nonalloc.s @@ -2,8 +2,8 @@ # Check reading addends for relocations in non-allocatable sections. # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t1.o -# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ -# RUN: %S/Inputs/mips-nonalloc.s -o %t2.o +# RUN: echo '.section .debug_info,"",@0x7000001e; .word __start' | \ +# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux - -o %t2.o # RUN: ld.lld %t1.o %t2.o -o %t.exe # RUN: llvm-objdump -t -s %t.exe | FileCheck %s @@ -18,6 +18,6 @@ __start: nop -.section .debug_info +.section .debug_info,"",@0x7000001e .word 0xffffffff .word __start diff --git a/lld/test/ELF/no-augmentation.s b/lld/test/ELF/no-augmentation.s index f4912ba68366..342f82907e1f 100644 --- a/lld/test/ELF/no-augmentation.s +++ b/lld/test/ELF/no-augmentation.s @@ -8,7 +8,7 @@ .global __start __start: -.section .eh_frame,"aw",@progbits +.section .eh_frame,"a",@progbits .4byte 9 .4byte 0x0 .byte 0x1 diff --git a/lld/test/ELF/ppc64-ld-got-dtprel.s b/lld/test/ELF/ppc64-ld-got-dtprel.s index 319c14e42cb9..b4f9f6478c65 100644 --- a/lld/test/ELF/ppc64-ld-got-dtprel.s +++ b/lld/test/ELF/ppc64-ld-got-dtprel.s @@ -36,7 +36,7 @@ addis 3, 2, j@got@dtprel@h addi 3, 2, j@got@dtprel -.section .tbss,"awT",@progbits +.section .tbss,"awT",@nobits .p2align 2 i: .long 0