forked from OSchip/llvm-project
[ELF] Linkerscript: fix bug in assignOffsets (check Sym for non-null)
llvm-svn: 278663
This commit is contained in:
parent
b3d1290c44
commit
b6f1bb13ae
|
@ -319,8 +319,10 @@ template <class ELFT> void assignOffsets(OutputSectionBase<ELFT> *Sec) {
|
|||
uintX_t Value = L->Cmd->Expression(Sec->getVA() + Off) - Sec->getVA();
|
||||
if (L->Cmd->Name == ".") {
|
||||
Off = Value;
|
||||
} else {
|
||||
auto *Sym = cast<DefinedSynthetic<ELFT>>(L->Cmd->Sym);
|
||||
} else if (auto *Sym =
|
||||
cast_or_null<DefinedSynthetic<ELFT>>(L->Cmd->Sym)) {
|
||||
// shouldDefine could have returned false, so we need to check Sym,
|
||||
// for non-null value.
|
||||
Sym->Section = OutSec;
|
||||
Sym->Value = Value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue