ports/devel/llvm/patches/patch-tools_lld_ELF_LinkerScript_cpp

23 lines
803 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
- XXX no comment
Index: tools/lld/ELF/LinkerScript.cpp
--- tools/lld/ELF/LinkerScript.cpp.orig
+++ tools/lld/ELF/LinkerScript.cpp
@@ -954,7 +954,6 @@ void LinkerScript::assignOffsets(OutputSection *sec) {
ctx->memRegion->name, sec->name);
}
- switchTo(sec);
// ctx->lmaOffset is LMA minus VMA. If LMA is explicitly specified via AT() or
// AT>, recompute ctx->lmaOffset; otherwise, if both previous/current LMA
@@ -968,6 +967,8 @@ void LinkerScript::assignOffsets(OutputSection *sec) {
ctx->lmaOffset = alignTo(mr->curPos, sec->alignment) - dot;
else if (!sameMemRegion || !prevLMARegionIsDefault)
ctx->lmaOffset = 0;
+
+ switchTo(sec);
// Propagate ctx->lmaOffset to the first "non-header" section.
if (PhdrEntry *l = ctx->outSec->ptLoad)