forked from OSchip/llvm-project
ELF: Do not follow relocation edges to output sections during GC.
This fixes an assertion error introduced by r320390. Differential Revision: https://reviews.llvm.org/D41095 llvm-svn: 320431
This commit is contained in:
parent
9c8d7f8dcc
commit
17f71de70b
|
@ -71,12 +71,13 @@ static void resolveReloc(InputSectionBase &Sec, RelT &Rel,
|
|||
SS->getFile<ELFT>()->IsNeeded = true;
|
||||
|
||||
if (auto *D = dyn_cast<Defined>(&B)) {
|
||||
if (!D->Section)
|
||||
auto *RelSec = dyn_cast_or_null<InputSectionBase>(D->Section);
|
||||
if (!RelSec)
|
||||
return;
|
||||
uint64_t Offset = D->Value;
|
||||
if (D->isSection())
|
||||
Offset += getAddend<ELFT>(Sec, Rel);
|
||||
Fn(cast<InputSectionBase>(D->Section), Offset);
|
||||
Fn(RelSec, Offset);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,4 +13,6 @@
|
|||
# CHECK-NEXT: Section: .dynamic
|
||||
|
||||
.data
|
||||
.globl g
|
||||
g:
|
||||
.quad _end
|
||||
|
|
Loading…
Reference in New Issue