llvm-project/lld/ELF
Sean Silva 03e41ee6a7 [lto] Initialize asmparsers.
Summary:
They are needed for inline asm during LTO.

In particular we hit the report_fatal_error on
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:138

    LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target

Reviewers: ruiu, rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D18027

llvm-svn: 263094
2016-03-10 04:58:52 +00:00
..
CMakeLists.txt ELF: link with BitWriter module 2016-03-09 21:38:04 +00:00
Config.h [lto] Add beginning of -save-temps option. 2016-03-09 20:01:08 +00:00
Driver.cpp [lto] Initialize asmparsers. 2016-03-10 04:58:52 +00:00
Driver.h Merge DarwinLdDriver and Driver. 2016-03-02 19:08:05 +00:00
DriverUtils.cpp ELF: Add --help option. 2016-02-28 03:18:09 +00:00
Error.cpp Rename 'fatal' to 'check' when it doesn't always fail. 2016-03-03 22:24:39 +00:00
Error.h Rename 'fatal' to 'check' when it doesn't always fail. 2016-03-03 22:24:39 +00:00
ICF.cpp Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
ICF.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
InputFiles.cpp Fixed "not all control paths return a value" warning. NFC. 2016-03-09 18:05:34 +00:00
InputFiles.h Handle comdat in LTO. 2016-03-02 15:43:50 +00:00
InputSection.cpp Remove an unnecessary hack. 2016-03-08 21:17:31 +00:00
InputSection.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
LinkerScript.cpp Revert "ELF: Add /lib and /usr/lib as default search paths." 2016-03-08 17:13:12 +00:00
LinkerScript.h ELF: Remove OutSection class and use a map instead. 2016-02-28 05:09:11 +00:00
MarkLive.cpp Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
Options.td [lto] Add beginning of -save-temps option. 2016-03-09 20:01:08 +00:00
OutputSections.cpp ELF: Remove non-standard ELF features from AMDGPU target. 2016-03-09 21:37:22 +00:00
OutputSections.h Remove an unnecessary hack. 2016-03-08 21:17:31 +00:00
README.md Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
SymbolTable.cpp [lto] Add saving the LTO .o file to -save-temps. 2016-03-09 22:30:05 +00:00
SymbolTable.h [ELF] - Create _DYNAMIC symbol for dynamic output 2016-03-01 16:23:13 +00:00
Symbols.cpp ELF: Remove non-standard ELF features from AMDGPU target. 2016-03-09 21:37:22 +00:00
Symbols.h lto: Record visibility in defined symbols. 2016-03-07 17:14:36 +00:00
Target.cpp Remove an unnecessary hack. 2016-03-08 21:17:31 +00:00
Target.h Delete isTlsDynRel. 2016-03-08 20:24:36 +00:00
Writer.cpp ELF: Remove non-standard ELF features from AMDGPU target. 2016-03-09 21:37:22 +00:00
Writer.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00

README.md

The New ELF Linker

This directory contains a port of the new PE/COFF linker for ELF.

Overall Design

See COFF/README.md for details on the design. Note that unlike COFF, we do not distinguish chunks from input sections; they are merged together.

Capabilities

This linker can link LLVM and Clang on Linux/x86-64 or FreeBSD/x86-64 "Hello world" can be linked on Linux/PPC64 and on Linux/AArch64 or FreeBSD/AArch64.

Performance

Achieving good performance is one of our goals. It's too early to reach a conclusion, but we are optimistic about that as it currently seems to be faster than GNU gold. It will be interesting to compare when we are close to feature parity.

Library Use

You can embed LLD to your program by linking against it and calling the linker's entry point function lld:🧝:link.

The current policy is that it is your reponsibility to give trustworthy object files. The function is guaranteed to return as long as you do not pass corrupted or malicious object files. A corrupted file could cause a fatal error or SEGV. That being said, you don't need to worry too much about it if you create object files in a usual way and give them to the linker (it is naturally expected to work, or otherwise it's a linker's bug.)