aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/pr25617-1a.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-03-07 08:24:35 -0800
committerH.J. Lu <hjl.tools@gmail.com>2023-06-29 10:29:47 -0700
commit3da917d534954ae727a2174039a3786b474dd712 (patch)
tree920e176681ee74e506779c876f3864640a9fbcfb /ld/testsuite/ld-elf/pr25617-1a.c
parent1ad1b8865c19598326ef9bbb125ab60e4e462b55 (diff)
downloadgdb-3da917d534954ae727a2174039a3786b474dd712.zip
gdb-3da917d534954ae727a2174039a3786b474dd712.tar.gz
gdb-3da917d534954ae727a2174039a3786b474dd712.tar.bz2
ld: Add tests for -z nosectionheader and --strip-section-headers
Add tests to verify that the linker option, -z nosectionheader and objcopy and strip option, --strip-section-headers, work correctly as well as linker issues an error when dynamic symbol table from PT_DYNAMIC segment is used. PR ld/25617 * testsuite/ld-elf/hash-2.d: New file. * testsuite/ld-elf/no-section-header.exp: Likewise. * testsuite/ld-elf/pr25617-1-no-sec-hdr.nd: Likewise. * testsuite/ld-elf/pr25617-1-no-sec-hdr.rd: Likewise. * testsuite/ld-elf/pr25617-1-static-no-sec-hdr.rd: Likewise. * testsuite/ld-elf/pr25617-1a-no-sec-hdr.nd: Likewise. * testsuite/ld-elf/pr25617-1a-no-sec-hdr.rd: Likewise. * testsuite/ld-elf/pr25617-1a-sec-hdr.rd: Likewise. * testsuite/ld-elf/pr25617-1a.c: Likewise. * testsuite/ld-elf/pr25617-1b.c: Likewise. * testsuite/ld-elf/start-noheader.rd: Likewise. * testsuite/ld-elf/start-shared-noheader-gnu.rd: Likewise. * testsuite/ld-elf/start-shared-noheader-sysv.rd: Likewise. * testsuite/ld-elf/start-shared-noheader.nd: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elf/pr25617-1a.c')
-rw-r--r--ld/testsuite/ld-elf/pr25617-1a.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr25617-1a.c b/ld/testsuite/ld-elf/pr25617-1a.c
new file mode 100644
index 0000000..f707f26
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr25617-1a.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int protected = 42;
+extern int *get_protected_ptr (void);
+
+void
+test()
+{
+ if (&protected == get_protected_ptr ())
+ printf ("PASS\n");
+}