llvm-project/lld/test/pecoff
Rui Ueyama 70f11d7589 Fix Weak External symbol handling.
The fallback atom was used only when it's searching for a symbol in a library;
if an undefined symbol was not found in a library, the LLD looked for its
fallback symbol in the library.

Although it worked in most cases, because symbols with fallbacks usually occur
only in OLDNAMES.LIB (a standard library), that behavior was incompatible with
link.exe. This patch fixes the issue so that the semantics is the same as
MSVC's link.exe

The new (and correct, I believe) behavior is this:

 - If there's no definition for an undefined atom, replace the undefined atom
   with its fallback and then proceed (e.g. look in the next file or stop
   linking as usual.)

Weak External symbols are underspecified in the Microsoft PE/COFF spec. However,
as long as I observed the behavior of link.exe, this seems to be what we want
for compatibility.

Differential Revision: http://llvm-reviews.chandlerc.com/D2162

llvm-svn: 195269
2013-11-20 20:51:55 +00:00
..
Inputs [PECOFF] Report error if there's unknown flag in .drectve 2013-11-05 23:53:15 +00:00
alignment.test [PECOFF] Handle edge case where no section alignment is specified. 2013-10-25 00:54:13 +00:00
base-reloc.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
baseaddr.test [PECOFF] Verify parameter in validateImpl() not in the driver. 2013-09-03 22:57:00 +00:00
bss-section.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
comdat.test [PECOFF] Add the entry symbol and /include symbols to dead strip root set. 2013-08-27 05:15:20 +00:00
common-symbol.test [PECOFF] Enable dead-stripping by default to match link.exe behavior. 2013-08-27 03:38:18 +00:00
dosstub.test [PECOFF] Minimum size of DOS stub is 64 byte. 2013-11-15 08:00:22 +00:00
drectve.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
dynamic.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
dynamicbase.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
entry.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
grouped-sections.test [PECOFF] Only COMDAT symbols are allowed to be dead-stripped. 2013-10-18 23:54:55 +00:00
hello.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
help.test [PECOFF] Fix /? option and add a test for the flag. 2013-09-24 17:59:30 +00:00
imagebase.test [PECOFF] Fix __ImageBase symbol. 2013-10-29 00:33:34 +00:00
importlib.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
include.test [lld][LinkingContext] Atoms created from command line options should be available in YAML 2013-08-31 05:27:38 +00:00
lib.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
manifest.test [PECOFF] Fix spelling in manifest XML. 2013-10-24 22:08:19 +00:00
multi.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
options.test [PECOFF] Add /swaprun:{cd,net} options. 2013-09-24 04:20:37 +00:00
reloc.test Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver" 2013-10-24 18:22:16 +00:00
resource.test [PECOFF] Fix the test to run. 2013-11-04 19:01:57 +00:00
trivial.test [PECOFF][Driver] Support /version command line option 2013-09-19 02:37:36 +00:00
unknown-drectve.test [PECOFF] Report error if there's unknown flag in .drectve 2013-11-05 23:53:15 +00:00
weak-external.test Fix Weak External symbol handling. 2013-11-20 20:51:55 +00:00