hanchenye-llvm-project/lld/ELF
Simon Atanasyan ea423e261f [ELF] Fix reading of PC values of FDEs
The patch fixes two related problems:
- If CIE augmentation string has 'L' token the CIE contains a byte
  defines LSDA encoding. We should skip this byte in `getFdeEncoding`
  routine. Before this fix we do not skip it and if the next token
  is 'R' treat this byte as FDE encoding.
- FDE encoding format has separate flags e.g. DW_EH_PE_pcrel for
  definition of relative pointers. We should add .eh_frame address to
  the PC value iif the DW_EH_PE_pcrel is specified.

http://www.airs.com/blog/archives/460

There is one more not fixed problem in this code. If PC value is encoded
using signed relative format e.g. DW_EH_PE_sdata4 | DW_EH_PE_pcrel we
should sign extend result of read32 to perform calculation correctly.
I am going to fix that in a separate patch.

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

llvm-svn: 262461
2016-03-02 05:38:42 +00:00
..
CMakeLists.txt Fix BUILD_SHARED_LIBS build. 2016-03-01 15:56:53 +00:00
Config.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
Driver.cpp [ELF] - handle of command line options incompatible with -r 2016-03-01 19:38:51 +00:00
Driver.h ELF: Add --help option. 2016-02-28 03:18:09 +00:00
DriverUtils.cpp ELF: Add --help option. 2016-02-28 03:18:09 +00:00
Error.cpp Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
Error.h Rename elf2 to elf. 2016-02-28 00:25:54 +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 lto: don't fetch members for weak undef. 2016-02-29 14:29:48 +00:00
InputFiles.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
InputSection.cpp Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
InputSection.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
LinkerScript.cpp ELF: Remove OutSection class and use a map instead. 2016-02-28 05:09:11 +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 Fix --help message. 2016-03-01 22:17:09 +00:00
OutputSections.cpp [ELF] Fix reading of PC values of FDEs 2016-03-02 05:38:42 +00:00
OutputSections.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
README.md Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
SymbolTable.cpp [ELF] - Create _DYNAMIC symbol for dynamic output 2016-03-01 16:23:13 +00:00
SymbolTable.h [ELF] - Create _DYNAMIC symbol for dynamic output 2016-03-01 16:23:13 +00:00
Symbols.cpp [ELF] - Create _DYNAMIC symbol for dynamic output 2016-03-01 16:23:13 +00:00
Symbols.h [ELF] - Create _DYNAMIC symbol for dynamic output 2016-03-01 16:23:13 +00:00
Target.cpp Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
Target.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
Writer.cpp [ELF] - More direct implementation of edata/etext 2016-03-01 19:18:07 +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.)