summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 235fa254bec..8624c5d3d56 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -142,10 +142,7 @@ void LinkerScript::assignSymbol(SymbolAssignment *Cmd, bool InSec) {
Sym->Value = V.getValue();
} else {
Sym->Section = V.Sec;
- if (Sym->Section->Flags & SHF_ALLOC)
- Sym->Value = alignTo(V.Val, V.Alignment);
- else
- Sym->Value = V.getValue();
+ Sym->Value = alignTo(V.Val, V.Alignment);
}
}
@@ -649,7 +646,9 @@ void LinkerScript::assignOffsets(OutputSectionCommand *Cmd) {
if (!Sec)
return;
- if (Cmd->AddrExpr && (Sec->Flags & SHF_ALLOC))
+ if (!(Sec->Flags & SHF_ALLOC))
+ Dot = 0;
+ else if (Cmd->AddrExpr)
setDot(Cmd->AddrExpr, Cmd->Location, false);
if (Cmd->LMAExpr) {
@@ -950,8 +949,6 @@ void LinkerScript::assignAddresses(
OutputSection *Sec = Cmd->Sec;
if (Sec->Flags & SHF_ALLOC)
MinVA = std::min<uint64_t>(MinVA, Sec->Addr);
- else
- Sec->Addr = 0;
}
allocateHeaders(Phdrs, OutputSectionCommands, MinVA);
OpenPOWER on IntegriCloud