Warn when a script redefines a symbol
authorAlan Modra <amodra@gmail.com>
Sat, 20 Feb 2021 05:15:44 +0000 (15:45 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 21 Feb 2021 03:58:16 +0000 (14:28 +1030)
commit89753bbf8102edc2aa4262a4d43f1a71a10e34f3
tree3afa35082bf7898409aa8e8ff507e8431b32c99d
parent93993f67849234cff651542c3d4d9f0f3d2fa651
Warn when a script redefines a symbol

Note that we don't even warn if scripts adjust a symbol as in
ld-elf/var1 and ld-scripts/pr14962.

include/
* bfdlink.h (struct bfd_link_info): Add warn_multiple_definition.
ld/
* ldexp.c (exp_fold_tree_1): Warn on script defining a symbol
defined in an object file.
* ldmain.c (multiple_definition): Heed info->warn_multiple_definition.
* testsuite/ld-scripts/defined5.d: Expect a warning.
include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/ldexp.c
ld/ldmain.c
ld/testsuite/ld-scripts/defined5.d