llvm-project/lld/ELF
Peter Smith 4e21c770ec [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page
The -n (--nmagic) disables page alignment, and acts as a -Bstatic
The -N (--omagic) does what -n does but also marks the executable segment as
writeable. As page alignment is disabled headers are not allocated unless
explicit in the linker script.

To disable page alignment in LLD we choose to set the page sizes to 1 so
that any alignment based on the page size does nothing. To set the
Target->PageSize to 1 we implement -z common-page-size, which has the side
effect of allowing the user to set the value as well.

Setting the page alignments to 1 does mean that any use of
CONSTANT(MAXPAGESIZE) or CONSTANT(COMMONPAGESIZE) in a linker script will
return 1, unlike in ld.bfd. However given that -n and -N disable paging
these probably shouldn't be used in a linker script where -n or -N is in
use.

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

llvm-svn: 360593
2019-05-13 16:01:26 +00:00
..
Arch [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
AArch64ErrataFix.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
AArch64ErrataFix.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Fail early if an output file is not writable 2019-03-11 16:30:55 +00:00
CallGraphSort.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
CallGraphSort.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Config.h [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
DWARF.cpp [ELF] Use llvm::bsearch. NFC 2019-04-17 08:00:46 +00:00
DWARF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver.cpp [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
Driver.h [WebAssembly] Handle command line options consistently with the ELF backend. 2019-05-08 16:20:05 +00:00
DriverUtils.cpp Add typo correction for command-line flags to ELF and COFF lld drivers 2019-05-07 13:48:30 +00:00
EhFrame.cpp [ELF][MachO][wasm] Simplify range-style std::find{,_if} with STLExtras.h utilities. NFC 2019-03-29 16:21:16 +00:00
EhFrame.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ICF.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
ICF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InputFiles.cpp Rename a variable and add a comment. 2019-04-10 06:32:05 +00:00
InputFiles.h [ELF] Fix typo: .symtab_shndxr -> .symtab_shndx 2019-04-12 02:20:52 +00:00
InputSection.cpp [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
InputSection.h [ELF] Place SectionPiece::{Live,Hash} bit fields together 2019-04-18 07:46:09 +00:00
LTO.cpp [ELF] Reorder BitcodeFiles.empty() to call thinLTOCreateEmptyIndexFiles() in only one place 2019-05-07 10:40:26 +00:00
LTO.h [ELF] Reorder BitcodeFiles.empty() to call thinLTOCreateEmptyIndexFiles() in only one place 2019-05-07 10:40:26 +00:00
LinkerScript.cpp [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
LinkerScript.h Replace `typedef A B` with `using B = A`. NFC. 2019-04-01 00:11:24 +00:00
MapFile.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
MapFile.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MarkLive.cpp Discard debuginfo for object files empty after GC 2019-04-10 10:37:10 +00:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
OutputSections.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
OutputSections.h [LLD][ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands. 2019-04-26 06:59:30 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
Relocations.cpp [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
Relocations.h [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
ScriptLexer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScriptLexer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScriptParser.cpp [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
ScriptParser.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SymbolTable.cpp [ELF] Reorder BitcodeFiles.empty() to call thinLTOCreateEmptyIndexFiles() in only one place 2019-05-07 10:40:26 +00:00
SymbolTable.h De-template SymbolTable::addShared. 2019-04-09 08:52:00 +00:00
Symbols.cpp [ELF] Emit weak-undef symbols in .dynsym of a PIE binary only if linked against shared libs. 2019-03-18 15:32:57 +00:00
Symbols.h ELF: De-template SharedFile. NFCI. 2019-04-08 17:35:55 +00:00
SyntheticSections.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
SyntheticSections.h [LLD][NFC] Refactor: BuildID hash size now computed in one place. 2019-05-09 08:08:09 +00:00
Target.cpp [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
Target.h [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
Thunks.cpp [mips] Remove redundant setup of less-significant bit. NFC 2019-03-13 16:00:35 +00:00
Thunks.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Writer.cpp [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
Writer.h [ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC 2019-03-15 07:16:39 +00:00

README.md

See docs/NewLLD.rst