summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-10-31 14:44:41 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-10-31 14:44:41 +0000
commit498ed714f8dcaec1b14476314f516824d29a32cb (patch)
tree3ba82635eaf90993fd23e0606a34b41879fc68cf
parentdb04833fcabea67dd38182fe81fab902015c1e8c (diff)
downloadbcm5719-llvm-498ed714f8dcaec1b14476314f516824d29a32cb.tar.gz
bcm5719-llvm-498ed714f8dcaec1b14476314f516824d29a32cb.zip
Simplify. NFC.
No need to subtract then add Sec->getVA(). llvm-svn: 285580
-rw-r--r--lld/ELF/LinkerScript.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 96862ccd44a..baf11f6e7d1 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -361,17 +361,17 @@ void LinkerScript<ELFT>::createSections(OutputSectionFactory<ELFT> &Factory) {
template <class ELFT>
static void assignSectionSymbol(SymbolAssignment *Cmd,
OutputSectionBase<ELFT> *Sec,
- typename ELFT::uint Off) {
+ typename ELFT::uint Value) {
if (!Cmd->Sym)
return;
if (auto *Body = dyn_cast<DefinedSynthetic<ELFT>>(Cmd->Sym)) {
Body->Section = Sec;
- Body->Value = Cmd->Expression(Sec->getVA() + Off) - Sec->getVA();
+ Body->Value = Cmd->Expression(Value) - Sec->getVA();
return;
}
auto *Body = cast<DefinedRegular<ELFT>>(Cmd->Sym);
- Body->Value = Cmd->Expression(Sec->getVA() + Off);
+ Body->Value = Cmd->Expression(Value);
}
template <class ELFT> static bool isTbss(OutputSectionBase<ELFT> *Sec) {
@@ -439,7 +439,7 @@ template <class ELFT> void LinkerScript<ELFT>::process(BaseCommand &Base) {
CurOutSec->setSize(Dot - CurOutSec->getVA());
return;
}
- assignSectionSymbol<ELFT>(AssignCmd, CurOutSec, Dot - CurOutSec->getVA());
+ assignSectionSymbol<ELFT>(AssignCmd, CurOutSec, Dot);
return;
}
OpenPOWER on IntegriCloud