ld: Add simple tests for -z nosectionheader
authorKaylee Blake <klkblake@gmail.com>
Thu, 5 Mar 2020 03:12:31 +0000 (13:42 +1030)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 29 Jun 2023 17:29:47 +0000 (10:29 -0700)
2020-06-06  Kaylee Blake  <klkblake@gmail.com>
    H.J. Lu  <hongjiu.lu@intel.com>

PR ld/25617
* testsuite/ld-elf/nosectionheader-1.d: New file.
* testsuite/ld-elf/nosectionheader-2.d: Likewise.

ld/testsuite/ld-elf/nosectionheader-1.d [new file with mode: 0644]
ld/testsuite/ld-elf/nosectionheader-2.d [new file with mode: 0644]

diff --git a/ld/testsuite/ld-elf/nosectionheader-1.d b/ld/testsuite/ld-elf/nosectionheader-1.d
new file mode 100644 (file)
index 0000000..cbaea66
--- /dev/null
@@ -0,0 +1,14 @@
+#source: start.s
+#ld: -z nosectionheader
+#readelf: -h -S
+#xfail: [uses_genelf]
+# These targets don't support -z.
+
+#...
+  Start of section headers:[ \t]+0 \(bytes into file\)
+#...
+  Size of section headers:[ \t]+0 \(bytes\)
+  Number of section headers:[ \t]+0
+  Section header string table index:[ \t]+0
+
+There are no sections in this file.
diff --git a/ld/testsuite/ld-elf/nosectionheader-2.d b/ld/testsuite/ld-elf/nosectionheader-2.d
new file mode 100644 (file)
index 0000000..38c344a
--- /dev/null
@@ -0,0 +1,4 @@
+#source: start.s
+#ld: -r -z nosectionheader
+#error:  -r and -z nosectionheader may not be used together
+#xfail: [uses_genelf]