diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-25 16:43:49 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-25 16:43:49 +0000 |
| commit | 667ffcf15305c53dde809af92bf68caed2e3e41e (patch) | |
| tree | 8ed9c8c35e92e5c971a5284b02bd432b420ece63 /lld/ELF/LinkerScript.cpp | |
| parent | 09c56b799f8bee6e88dbb0ef489fa2b2def6e2f6 (diff) | |
| download | bcm5719-llvm-667ffcf15305c53dde809af92bf68caed2e3e41e.tar.gz bcm5719-llvm-667ffcf15305c53dde809af92bf68caed2e3e41e.zip | |
Simplify. NFC.
llvm-svn: 323440
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 6bd5d0ff7b2..86932736b78 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -656,22 +656,18 @@ void LinkerScript::assignOffsets(OutputSection *Sec) { switchTo(Sec); - if (Sec->LMAExpr) { - uint64_t D = Dot; - Ctx->LMAOffset = [=] { return Sec->LMAExpr().getValue() - D; }; - } + if (Sec->LMAExpr) + Ctx->LMAOffset = Sec->LMAExpr().getValue() - Dot; - if (MemoryRegion *MR = Sec->LMARegion) { - uint64_t Offset = MR->Origin - Dot; - Ctx->LMAOffset = [=] { return Offset; }; - } + if (MemoryRegion *MR = Sec->LMARegion) + Ctx->LMAOffset = MR->Origin - Dot; // If neither AT nor AT> is specified for an allocatable section, the linker // will set the LMA such that the difference between VMA and LMA for the // section is the same as the preceding output section in the same region // https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html if (Ctx->LMAOffset) - Ctx->OutSec->LMAOffset = Ctx->LMAOffset(); + Ctx->OutSec->LMAOffset = Ctx->LMAOffset; // The Size previously denoted how many InputSections had been added to this // section, and was used for sorting SHF_LINK_ORDER sections. Reset it to |

