Currently LLD ignores undefined symbols found in DSOs when linking against
DSO files, if -shared flag is given. Internally, it's achieved by enabling
"useShlibUndefines" flag, which makes the file reader to ignore all undefined
symbols in DSO, so that Resolver don't see any undefined symbols when
handling DSO files.
The above behavior is not compatible with GNU LD.
GNU LD does not also warn on undefined symbols found in DSOs if -shared flag
is given. However, it actually tries to resolve such undefined symbols. As a
result, if an undefined symbol can be resolved by other objects/DSOs appears
later in the same command line, linking output will be different from LLD's
result.
This patch fixes the compatibilty issue. GNU LD seems to just not print
warning messages on undefined symbols if -shared is given. This patch
implements the same behavior.
It's a bit hard to understand that there is no functional changes here and the only code modification is a variable renaming. Maybe move such changes to the separate commit?