llvm-project/lld
Rui Ueyama b4dca7f065 Select new undefined atom rather than old one if other conditions are the same.
We can add multiple undefined atoms having the same name to the symbol table.
If such atoms are added, the symbol table compares their canBeNull attributes,
and select one having a stronger constraint. If their canBeNulls are the same,
the choice is arbitrary. Currently it choose the existing one.

This patch changes the preference, so that the symbol table choose the new one
if the new atom has a greater canBeNull or a fallback atom. This shouldn't
change the behavior except the case described below.

A new undefined atom may have a new fallback atom attribute. By choosing the new
atom, we can update the fallback atom during Core Linking. PE/COFF actually need
that. For example, _lseek is an alias for __lseek on Windows. One of an object
file in OLDNAMES.LIB has an undefined atom for _lseek with the fallback to
__lseek. When the linker tries to resolve _read, it supposed to read the file
from OLDNAMES.LIB and use the new fallback from the file. Currently LLD cannot
handle such case because duplicate undefined atoms with the same attributes are
ignored.

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

llvm-svn: 194777
2013-11-15 03:12:24 +00:00
..
cmake/modules Add VTune as an optional external dependency and add task tracking. 2013-04-06 00:56:40 +00:00
docs Update documentation. 2013-09-07 18:01:39 +00:00
include/lld Fix include guards. 2013-11-15 03:09:26 +00:00
lib Select new undefined atom rather than old one if other conditions are the same. 2013-11-15 03:12:24 +00:00
test Select new undefined atom rather than old one if other conditions are the same. 2013-11-15 03:12:24 +00:00
tools Make Driver::link and LinkingContext::validate return true on success. 2013-09-24 23:26:34 +00:00
unittests [mach-o] revert gunk added to test cases to debug build bot failures 2013-11-08 23:18:51 +00:00
utils Add basic linker script parsing. 2013-03-01 00:03:36 +00:00
.arcconfig Add .arcconfig for Phabricator command-line support 2013-01-03 02:15:37 +00:00
.gitignore docs: Sketch Sphinx based docs structure. 2012-04-06 21:02:20 +00:00
CMakeLists.txt Get lld building with MSVC2013 2013-11-12 15:14:33 +00:00
LICENSE.TXT Update the copyright coredits -- Happy new year 2013! 2013-01-01 10:00:19 +00:00
README.md Test commit 2012-09-14 00:00:39 +00:00

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.