llvm-project/lld/COFF/CMakeLists.txt

41 lines
622 B
CMake
Raw Normal View History

set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(COFFOptionsTableGen)
add_lld_library(lldCOFF
Chunks.cpp
DLL.cpp
Driver.cpp
DriverUtils.cpp
Error.cpp
ICF.cpp
InputFiles.cpp
COFF: drop the dependency on LIB.EXE for implibs lld currently relies on lib.exe in order to generate an empty import library. The "empty" import library consists of 5 members: - first linker member - second linker member - Import Descriptor - NULL Import Descriptor - NULl Thunk The first two entries (first and second linker members) are string tables which are never updated. Therefore, they may as well as not be present. A subsequent change to add that is probably warranted. However, this does not prevent the use of the linker. The Import Descriptor is the content which is most important. It provides an Import Name Table entry for the library (as specified by the LIBRARY directive in the DEF file). Additionally, it contains undefined references to the NULL Import Descriptor and the library NULL Thunk Data. This ensures that the linker will pull in the subsequent objects from the import library for the link. The Import Descriptor has a single symbol (__IMPORT_DESCRIPTOR_<Library>) which contains 3 relocations, one to the INT (Import Name Table) entry, one to the ILT (Import Lookup Table) entry, and one to the IAT (Import Address Table) entry. The NULL Import Descriptor is the last import descriptor and terminates the import descriptor array. It contains a single symbol (__NULL_IMPORT_DESCRIPTOR). The NULL Thunk contains a single symbol (\x7f<Library>_NULL_THUNK_DATA) and provides the terminator for the ILT and IAT. These files are currently constructed manually following the example of the Short Import Library format. This is arguably less than ideal, and it may be possible to use MCAssembler and feed it the fragments to construct the object. The major difference between the LIB (LINK) generated objects and the ones generated here is that they are all one section shorter (.debug$S) as they do not contain the debug information and one symbol shorter (@comp.id) as they do not contain the RICH signature. Move the logic related to the librarian into a new source file (Librarian.cpp). llvm-svn: 275242
2016-07-13 11:19:27 +08:00
Librarian.cpp
MarkLive.cpp
ModuleDef.cpp
PDB.cpp
SymbolTable.cpp
Symbols.cpp
Writer.cpp
LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
Core
DebugInfoMSF
DebugInfoPDB
LTO
LibDriver
Object
MC
MCDisassembler
Target
Option
Support
LINK_LIBS
lldCore
${PTHREAD_LIB}
)
add_dependencies(lldCOFF COFFOptionsTableGen intrinsics_gen)