Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] Postpone evaluation of ORIGIN/LENGTH in a MEMORY command
``` createFiles(args) readDefsym readerLinkerScript(*mb) ... readMemory readMemoryAssignment("ORIGIN", "org", "o") // eagerly evaluated target = getTarget(); link(args) writeResult<ELFT>() ... finalizeSections() script->processSymbolAssignments() addSymbol(cmd) // with this patch, evaluated here ``` readMemoryAssignment eagerly evaluates ORIGIN/LENGTH and returns an uint64_t. This patch postpones the evaluation to make * --defsym and symbol assignments * `CONSTANT(COMMONPAGESIZE)` (requires a non-null `lld::elf::target`) work. If the expression somehow requires interaction with memory regions, the circular dependency may cause the expression to evaluate to a strange value. See the new test added to memory-err.s Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D75763
- Loading branch information
Showing
5 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters