ELF: Create synthetic sections for loadable partitions.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 7 Jun 2019 17:57:58 +0000 (17:57 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 7 Jun 2019 17:57:58 +0000 (17:57 +0000)
commit02828985868ca5c9788824077d74a6d674a686e2
tree093fa4773d81e7d2b0caf461667e722418677178
parent8d58a98c594bb472b01158ba825cd632650ec2be
ELF: Create synthetic sections for loadable partitions.

We create several types of synthetic sections for loadable partitions, including:
- The dynamic symbol table. This allows code outside of the loadable partitions
  to find entry points with dlsym.
- Creating a dynamic symbol table also requires the creation of several other
  synthetic sections for the partition, such as the dynamic table and hash table
  sections.
- The partition's ELF header is represented as a synthetic section in the
  combined output file, and will be used by llvm-objcopy to extract partitions.

Differential Revision: https://reviews.llvm.org/D62350

llvm-svn: 362819
17 files changed:
lld/ELF/Arch/PPC.cpp
lld/ELF/Arch/X86.cpp
lld/ELF/Arch/X86_64.cpp
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/InputSection.h
lld/ELF/LinkerScript.cpp
lld/ELF/Relocations.cpp
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h
lld/ELF/Thunks.cpp
lld/ELF/Writer.cpp
lld/test/ELF/linkerscript/orphan-report.s
lld/test/ELF/partition-exidx.s [new file with mode: 0644]
lld/test/ELF/partition-notes.s [new file with mode: 0644]
lld/test/ELF/partition-pack-dyn-relocs.s [new file with mode: 0644]
lld/test/ELF/partition-synthetic-sections.s [new file with mode: 0644]