llvm-project/lld/ELF
Hal Finkel c91740616a [ELF2] Don't create RelativeReloc for weak undef symbols
When we have a R_PPC64_ADDR64 for a weak undef symbol, which thus resolves to
0, and we're creating a shared library, we need to make sure that it stays 0
(because code that conditionally calls the weak function tests for this).
Unfortunately, we were creating a R_PPC64_RELATIVE for these relocation
targets, making the address of the undefined weak symbol equal to the base
address of the shared library (which is non-zero). In general, we should not be
creating RelativeReloc relocs for undef weak symbols.

llvm-svn: 250558
2015-10-16 22:11:05 +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: Support --entry=<addr>. 2015-10-14 22:20:57 +00:00
Driver.cpp ELF2: Support --entry=<addr>. 2015-10-14 22:20:57 +00:00
Driver.h Simplify the InputFile type hierarchy. 2015-10-12 01:55:32 +00:00
DriverUtils.cpp ELF2: Remove ArgParser class and define parseArgs() function instead. 2015-10-11 18:19:01 +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 a ObjectFile<ELFT>::getSection helper and simplify. NFC. 2015-10-16 15:29:48 +00:00
InputFiles.h Add a ObjectFile<ELFT>::getSection helper and simplify. NFC. 2015-10-16 15:29:48 +00:00
InputSection.cpp [ELF2] getLocalRelTarget should handle R_PPC64_TOC directly 2015-10-16 21:55:40 +00:00
InputSection.h ELF2: Use ELFT to template OutputSections. 2015-10-15 22:27:29 +00:00
LinkerScript.cpp [ELF2/Linkerscript] Skip semicolon in linker directives parsing. 2015-10-13 20:48:56 +00:00
Options.td Recognize -Bshareable alias for -shared 2015-10-15 13:03:16 +00:00
OutputSections.cpp [ELF2] Don't create RelativeReloc for weak undef symbols 2015-10-16 22:11:05 +00:00
OutputSections.h [ELF2] getLocalRelTarget should handle R_PPC64_TOC directly 2015-10-16 21:55:40 +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: Inititalize other symbols only once as well. 2015-10-08 00:44:28 +00:00
Symbols.h ELF2: Use ELFT to template OutputSections. 2015-10-15 22:27:29 +00:00
Target.cpp [ELF2] getLocalRelTarget should handle R_PPC64_TOC directly 2015-10-16 21:55:40 +00:00
Target.h [ELF2] getLocalRelTarget should handle R_PPC64_TOC directly 2015-10-16 21:55:40 +00:00
Writer.cpp ELF2: Use ELFT to template OutputSections. 2015-10-15 22:27:29 +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.