We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7dd41fa commit 9abb592Copy full SHA for 9abb592
lld/COFF/Chunks.cpp
@@ -652,6 +652,13 @@ void SectionChunk::getRuntimePseudoRelocs(
652
dyn_cast_or_null<Defined>(file->getSymbol(rel.SymbolTableIndex));
653
if (!target || !target->isRuntimePseudoReloc)
654
continue;
655
+ // If the target doesn't have a chunk allocated, it may be a
656
+ // DefinedImportData symbol which ended up unnecessary after GC.
657
+ // Normally we wouldn't eliminate section chunks that are referenced, but
658
+ // references within DWARF sections don't count for keeping section chunks
659
+ // alive. Thus such dangling references in DWARF sections are expected.
660
+ if (!target->getChunk())
661
+ continue;
662
int sizeInBits =
663
getRuntimePseudoRelocSize(rel.Type, file->ctx.config.machine);
664
if (sizeInBits == 0) {
0 commit comments