Skip to content

Commit 9abb592

Browse files
authored
1 parent 7dd41fa commit 9abb592

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lld/COFF/Chunks.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,13 @@ void SectionChunk::getRuntimePseudoRelocs(
652652
dyn_cast_or_null<Defined>(file->getSymbol(rel.SymbolTableIndex));
653653
if (!target || !target->isRuntimePseudoReloc)
654654
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;
655662
int sizeInBits =
656663
getRuntimePseudoRelocSize(rel.Type, file->ctx.config.machine);
657664
if (sizeInBits == 0) {

0 commit comments

Comments
 (0)