elf: Treat undefined version as hidden
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 1 Aug 2021 14:26:20 +0000 (07:26 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Aug 2021 12:07:42 +0000 (05:07 -0700)
commitf897689c880ed1049b708e6c1f9745c8604808e3
tree7ed28cb0d032325e8d8d00704dddf391bff9c131
parent6a7ee0010e63a3eac4c58c48f2484a0fafdb7d2e
elf: Treat undefined version as hidden

Since undefined version can't be used to resolve any references without
the original definition, treat it as hidden.

bfd/

PR binutils/28158
* elf.c (_bfd_elf_get_symbol_version_string): Treat undefined
version as hidden.

ld/

PR binutils/28158
* testsuite/ld-elf/linux-x86.exp: Run PR binutils/28158 tests.
* testsuite/ld-elf/pr28158-1.c: New file.
* testsuite/ld-elf/pr28158-2.S: Likewise.
* testsuite/ld-elf/pr28158.nd: Likewise.
* testsuite/ld-elf/pr28158.rd: Likewise.
* testsuite/ld-elf/pr28158.t: Likewise.
* testsuite/ld-elfvers/vers2.dsym: Updated.
* testsuite/ld-elfvers/vers3.dsym: Likewise.
* testsuite/ld-elfvers/vers6.dsym: Likewise.
* testsuite/ld-elfvers/vers19.dsym: Likewise.
* testsuite/ld-elfvers/vers22.dsym: Likewise.
* testsuite/ld-elfvers/vers23.dsym: Likewise.
* testsuite/ld-elfvers/vers23d.dsym: Likewise.
* testsuite/ld-elfvers/vers27d4.dsym: Likewise.
* testsuite/ld-elfvers/vers28c.dsym: Likewise.
16 files changed:
bfd/elf.c
ld/testsuite/ld-elf/linux-x86.exp
ld/testsuite/ld-elf/pr28158-1.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr28158-2.S [new file with mode: 0644]
ld/testsuite/ld-elf/pr28158.nd [new file with mode: 0644]
ld/testsuite/ld-elf/pr28158.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr28158.t [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers19.dsym
ld/testsuite/ld-elfvers/vers2.dsym
ld/testsuite/ld-elfvers/vers22.dsym
ld/testsuite/ld-elfvers/vers23.dsym
ld/testsuite/ld-elfvers/vers23d.dsym
ld/testsuite/ld-elfvers/vers27d4.dsym
ld/testsuite/ld-elfvers/vers28c.dsym
ld/testsuite/ld-elfvers/vers3.dsym
ld/testsuite/ld-elfvers/vers6.dsym