llvm-project/lld/ELF
George Rimar f6bc65a3b2 Reapply r257753 with fix:
Added check for terminator CIE/FDE which has zero data size.
void EHOutputSection<ELFT>::addSectionAux(
...
 // If CIE/FDE data length is zero then Length is 4, this
 // shall be considered a terminator and processing shall end.
    if (Length == 4)
      break;
...

After this "Bug 25923 - lld/ELF2 linked application crashes if exceptions were used." is fixed for me. Self link of clang also works.

Initial commit message:
[ELF] - implemented --eh-frame-hdr command line option.

--eh-frame-hdr
Request creation of ".eh_frame_hdr" section and ELF "PT_GNU_EH_FRAME" segment header.

Both gold and the GNU linker support an option --eh-frame-hdr which tell them to construct a header for all the .eh_frame sections. This header is placed in a section named .eh_frame_hdr and also in a PT_GNU_EH_FRAME segment. At runtime the unwinder can find all the PT_GNU_EH_FRAME segments by calling dl_iterate_phdr.
This section contains a lookup table for quick binary search of FDEs.
Detailed info can be found here:
http://www.airs.com/blog/archives/462

Differential revision: http://reviews.llvm.org/D15712

llvm-svn: 257889
2016-01-15 13:34:52 +00:00
..
CMakeLists.txt Set the folder for libraries to 'lld libraries'. NFC. 2016-01-07 00:14:04 +00:00
Config.h Reapply r257753 with fix: 2016-01-15 13:34:52 +00:00
Driver.cpp Reapply r257753 with fix: 2016-01-15 13:34:52 +00:00
Driver.h ELF: Make private functions private. 2016-01-07 17:54:21 +00:00
DriverUtils.cpp Remove unnecessary `lld::`. 2016-01-06 20:11:55 +00:00
Error.cpp [ELF2] Output of all unknown arguments instead of only one. 2015-09-24 18:55:33 +00:00
Error.h [ELF2] Output of all unknown arguments instead of only one. 2015-09-24 18:55:33 +00:00
InputFiles.cpp Simplify MipsReginfoInputSection. 2016-01-06 22:42:43 +00:00
InputFiles.h Rename GroupEntryType -> uint32_X. 2016-01-06 20:30:02 +00:00
InputSection.cpp ELF: Remove dead code. 2016-01-08 20:11:47 +00:00
InputSection.h Simplify MipsReginfoInputSection. 2016-01-06 22:42:43 +00:00
LinkerScript.cpp Remove unnecessary `lld::`. 2016-01-06 20:11:55 +00:00
MarkLive.cpp Merge two consecutive if's. NFC. 2016-01-12 21:57:44 +00:00
Options.td Reapply r257753 with fix: 2016-01-15 13:34:52 +00:00
OutputSections.cpp Reapply r257753 with fix: 2016-01-15 13:34:52 +00:00
OutputSections.h Reapply r257753 with fix: 2016-01-15 13:34:52 +00:00
README.md [README] Update to reflect the new world order. 2015-12-24 10:03:46 +00:00
SymbolTable.cpp Demangle symbols when including them in error messages. 2016-01-13 18:55:39 +00:00
SymbolTable.h [ELF][MIPS] Prevent substitution of _gp_disp symbol 2016-01-12 06:23:57 +00:00
Symbols.cpp Update comment for __cxa_demangle again to make it precise. 2016-01-13 22:09:09 +00:00
Symbols.h Demangle symbols when including them in error messages. 2016-01-13 18:55:39 +00:00
Target.cpp [ELF/AArch64] Add support for R_AARCH64_LDST16_ABS_LO12_NC relocation. 2016-01-15 01:49:51 +00:00
Target.h [ELF][MIPS] Ignore 'hint' relocations like R_MIPS_JALR in the `scanRelocs` method 2016-01-14 20:42:09 +00:00
Writer.cpp Reapply r257753 with fix: 2016-01-15 13:34:52 +00:00
Writer.h ELF2: Implement --gc-sections. 2015-10-22 18:49:53 +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.