ELF: Properly handle section symbols
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 10 Jun 2020 12:31:19 +0000 (05:31 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 10 Jun 2020 12:31:31 +0000 (05:31 -0700)
commite1b5d517d1c293a64df311d2749bbbbfbe035a4c
tree8f608a55c2b8004b5a706d8dbee71d2eb7c80885
parent25065fcd192d9958c03e107985aea41d651e4a16
ELF: Properly handle section symbols

When defining the section symbol, __start_FOO, for the section FOO:

1. Treat the common symbol, __start_FOO, in input object file as
definition.
2. Clear verinfo.verdef.

bfd/

PR ld/26094
* elflink.c (bfd_elf_define_start_stop): Handle common symbols.
Clear verinfo.verdef.

ld/

PR ld/26094
* testsuite/ld-elf/pr26094-1.ver: New fike.
* testsuite/ld-elf/pr26094-1a.c: Likewise.
* testsuite/ld-elf/pr26094-1a.rd: Likewise.
* testsuite/ld-elf/pr26094-1b.c: Likewise.
* testsuite/ld-elf/pr26094-1b.rd: Likewise.
* testsuite/ld-elf/pr26094-1c.c: Likewise.
* testsuite/ld-elf/shared.exp: Run ld/26094 tests.
bfd/ChangeLog
bfd/elflink.c
ld/ChangeLog
ld/testsuite/ld-elf/pr26094-1.ver [new file with mode: 0644]
ld/testsuite/ld-elf/pr26094-1a.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr26094-1a.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr26094-1b.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr26094-1b.rd [new file with mode: 0644]
ld/testsuite/ld-elf/pr26094-1c.c [new file with mode: 0644]
ld/testsuite/ld-elf/shared.exp