diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-27 19:50:45 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-07-27 19:50:54 +0000 |
| commit | 08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (patch) | |
| tree | 041e72e32710b1e742516d8c9f1575bf0116d3e3 /lld/ELF/LinkerScript.cpp | |
| parent | 4b4fe385e49bd883fd183b5f21c1ea486c722e61 (diff) | |
vendor/llvm-project/llvmorg-15-init-17827-gd77882e66779vendor/llvm-project/llvmorg-15-init-17826-g1f8ae9d7e7e4
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 3be42904b7fe..9f30117c0279 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -112,9 +112,9 @@ static StringRef getOutputSectionName(const InputSectionBase *s) { uint64_t ExprValue::getValue() const { if (sec) - return alignTo(sec->getOutputSection()->addr + sec->getOffset(val), - alignment); - return alignTo(val, alignment); + return alignToPowerOf2(sec->getOutputSection()->addr + sec->getOffset(val), + alignment); + return alignToPowerOf2(val, alignment); } uint64_t ExprValue::getSecAddr() const { @@ -989,7 +989,7 @@ void LinkerScript::assignOffsets(OutputSection *sec) { // sec->alignment is the max of ALIGN and the maximum of input // section alignments. const uint64_t pos = dot; - dot = alignTo(dot, sec->alignment); + dot = alignToPowerOf2(dot, sec->alignment); sec->addr = dot; expandMemoryRegions(dot - pos); } @@ -1003,7 +1003,7 @@ void LinkerScript::assignOffsets(OutputSection *sec) { if (sec->lmaExpr) { ctx->lmaOffset = sec->lmaExpr().getValue() - dot; } else if (MemoryRegion *mr = sec->lmaRegion) { - uint64_t lmaStart = alignTo(mr->curPos, sec->alignment); + uint64_t lmaStart = alignToPowerOf2(mr->curPos, sec->alignment); if (mr->curPos < lmaStart) expandMemoryRegion(mr, lmaStart - mr->curPos, sec->name); ctx->lmaOffset = lmaStart - dot; @@ -1046,7 +1046,7 @@ void LinkerScript::assignOffsets(OutputSection *sec) { for (InputSection *isec : cast<InputSectionDescription>(cmd)->sections) { assert(isec->getParent() == sec); const uint64_t pos = dot; - dot = alignTo(dot, isec->alignment); + dot = alignToPowerOf2(dot, isec->alignment); isec->outSecOff = dot - sec->addr; dot += isec->getSize(); |
