[LLD] Search archives for symbol defs to override COMMON symbols.
authorSean Fertile <sd.fertile@gmail.com>
Mon, 7 Dec 2020 14:28:17 +0000 (09:28 -0500)
committerSean Fertile <sd.fertile@gmail.com>
Mon, 7 Dec 2020 15:09:19 +0000 (10:09 -0500)
commit8f91f38148e84a1b3fd8b5a090e53ff5dd0258f5
treedf4d5a36469ebf8e35ee8e63b5d0a759bc4400d5
parent733e2ae8cdf3d13e0a1ef9878e8500f446ffa699
[LLD] Search archives for symbol defs to override COMMON symbols.

This patch changes the archive handling to enable the semantics needed
for legacy FORTRAN common blocks and block data. When we have a COMMON
definition of a symbol and are including an archive, LLD will now
search the members for global/weak defintions to override the COMMON
symbol. The previous LLD behavior (where a member would only be included
if it satisifed some other needed symbol definition) can be re-enabled with the
option '-no-fortran-common'.

Differential Revision: https://reviews.llvm.org/D86142
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/InputFiles.cpp
lld/ELF/InputFiles.h
lld/ELF/Options.td
lld/ELF/Symbols.cpp
lld/docs/ld.lld.1
lld/test/ELF/common-archive-lookup.s [new file with mode: 0644]
lld/test/ELF/warn-backrefs.s