ld: Add a test for PR ld/27259
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 28 Jan 2021 13:36:51 +0000 (05:36 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 28 Jan 2021 13:40:07 +0000 (05:40 -0800)
PR ld/27259
* testsuite/ld-elf/pr27259.d: New file.
* testsuite/ld-elf/pr27259.s: Likewise.

ld/ChangeLog
ld/testsuite/ld-elf/pr27259.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr27259.s [new file with mode: 0644]

index 9dfff4af284a9e04fa908951501aeb6aa502a406..6d47b7be36ac00c54179f4fa37b19d3f8c5c9530 100644 (file)
@@ -1,3 +1,9 @@
+2021-01-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/27259
+       * testsuite/ld-elf/pr27259.d: New file.
+       * testsuite/ld-elf/pr27259.s: Likewise.
+
 2021-01-28  Alan Modra  <amodra@gmail.com>
 
        PR 27259
diff --git a/ld/testsuite/ld-elf/pr27259.d b/ld/testsuite/ld-elf/pr27259.d
new file mode 100644 (file)
index 0000000..1cb6a87
--- /dev/null
@@ -0,0 +1,7 @@
+#ld: --gc-sections -e _start
+#target: [check_gc_sections_available]
+#readelf: -SW
+
+#...
+ +\[ *[0-9]+\] \.stack_sizes +PROGBITS +0+ +[0-9a-f]+ 0+1 +00 +L +[0-9] .*
+#pass
diff --git a/ld/testsuite/ld-elf/pr27259.s b/ld/testsuite/ld-elf/pr27259.s
new file mode 100644 (file)
index 0000000..a7c42d8
--- /dev/null
@@ -0,0 +1,14 @@
+       .section .stack_sizes,"o",%progbits,live,unique,0
+live:
+       .byte 1
+
+       .section .stack_sizes,"o",%progbits,dead,unique,1
+dead:
+       .byte 2
+
+       .section .text.main,"ax",%progbits
+       .globl _start
+_start:
+       .byte 0
+       .section .note,"",%note
+       .dc.a live