hanchenye-llvm-project/lld/ELF
Igor Kudrin 1b0d7066ff [ELF2] Add support for GNU Hash section
This patch implements --hash-style command line switch.

* By default, or with "sysv" or "both" parameters, the linker generates
  a standard ELF hash section.
* With "gnu" or "both", it produces a GNU-style hash section.

That section requires the symbols in the dynamic symbol table section, which
are referenced in the GNU hash section, to be placed after not hashed ones and
to be sorted to correspond the order of hash buckets in the GNU Hash section.

The division function, as well as estimations for the section's parameters,
are just the first rough attempt and the subjects for further adjustments.

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

llvm-svn: 251000
2015-10-22 08:21:35 +00:00
..
CMakeLists.txt ELF2: Create LinkerScript.cpp and move code from DriverUtils to there. 2015-09-30 17:23:26 +00:00
Config.h [ELF2] Add support for GNU Hash section 2015-10-22 08:21:35 +00:00
Driver.cpp [ELF2] Add support for GNU Hash section 2015-10-22 08:21:35 +00:00
Driver.h Simplify the InputFile type hierarchy. 2015-10-12 01:55:32 +00:00
DriverUtils.cpp Update lld to match llvm r250901. OptTable constructor now takes an ArrayRef. NFC 2015-10-21 16:31:56 +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 Add support for merging the contents of SHF_MERGE sections. 2015-10-19 21:00:02 +00:00
InputFiles.h Add support for merging the contents of SHF_MERGE sections. 2015-10-19 21:00:02 +00:00
InputSection.cpp Fix symbol value calculation in SHF_MERGE. 2015-10-20 22:08:49 +00:00
InputSection.h Add support for merging the contents of SHF_MERGE sections. 2015-10-19 21:00:02 +00:00
LinkerScript.cpp [ELF2] - Linker script EXTERN command implemented. 2015-10-19 17:35:12 +00:00
Options.td [ELF2] Add support for GNU Hash section 2015-10-22 08:21:35 +00:00
OutputSections.cpp [ELF2] Add support for GNU Hash section 2015-10-22 08:21:35 +00:00
OutputSections.h [ELF2] Add support for GNU Hash section 2015-10-22 08:21:35 +00:00
README.md ELF2: Add a note about performance. 2015-10-13 21:28:02 +00:00
SymbolTable.cpp ELF2: Use ELFT to template OutputSections. 2015-10-15 22:27:29 +00:00
SymbolTable.h ELF2: Use ELFT to template OutputSections. 2015-10-15 22:27:29 +00:00
Symbols.cpp ELF2: Avoid bitwise-OR hack. NFC. 2015-10-21 19:41:03 +00:00
Symbols.h ELF2: Rename getMostConstrainingVisibility -> getVisibility. NFC. 2015-10-21 18:13:47 +00:00
Target.cpp ELF2: Remove FIXMEs. 2015-10-21 21:13:35 +00:00
Target.h [ELF2] - Lazy relocation support for x86_64. 2015-10-20 08:54:27 +00:00
Writer.cpp [ELF2] Add support for GNU Hash section 2015-10-22 08:21:35 +00:00
Writer.h ELF2: Make SymbolTable a template class. 2015-10-09 21:07:25 +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 with -LLVM_ENABLE_THREADS=OFF. "Hello world" can be linked on Linux/PPC64.

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.