ld: Add tests for -z nosectionheader and --strip-section-headers
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 7 Mar 2020 16:24:35 +0000 (08:24 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 29 Jun 2023 17:29:47 +0000 (10:29 -0700)
commit3da917d534954ae727a2174039a3786b474dd712
tree920e176681ee74e506779c876f3864640a9fbcfb
parent1ad1b8865c19598326ef9bbb125ab60e4e462b55
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.
14 files changed:
ld/testsuite/ld-elf/hash-2.d [new file with mode: 0644]
ld/testsuite/ld-elf/no-section-header.exp [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1-no-sec-hdr.nd [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1-no-sec-hdr.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1-static-no-sec-hdr.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1a-no-sec-hdr.nd [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1a-no-sec-hdr.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1a-sec-hdr.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1a.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr25617-1b.c [new file with mode: 0644]
ld/testsuite/ld-elf/start-noheader.rd [new file with mode: 0644]
ld/testsuite/ld-elf/start-shared-noheader-gnu.rd [new file with mode: 0644]
ld/testsuite/ld-elf/start-shared-noheader-sysv.rd [new file with mode: 0644]
ld/testsuite/ld-elf/start-shared-noheader.nd [new file with mode: 0644]