[lld] [COFF] Make ICF compare .pdata xdata references (PR #205456)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 16:52:49 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Reid Kleckner (rnk)
<details>
<summary>Changes</summary>
Alternative solution to https://reviews.llvm.org/D82883 and #<!-- -->199705
This change makes ICF tolerant to precompiled inputs that don't use comdats to associate .xdata with .text. Otherwise, ICF will silently change the semantics of the linked binary in very surprising ways.
Arguably, the inputs are corrupt, but I think a linker should be extra defensive in cases like this, since this has come up more than once. It's really easy to create this kind of object file from pure assembly or an alternative frontend.
The code is LLM-generated, and I think it could use significant work to make it clearer. You could take the idea of "parsing" pdata a lot further. It's not clear we even need to model pdata as SectionChunks. We could parse it and represent it more directly, although I suppose that would make the linker more brittle to invalid inputs.
This is a starting point, let me know if it seems like a promising direction and I'll polish it.
---
Patch is 28.51 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/205456.diff
3 Files Affected:
- (modified) lld/COFF/ICF.cpp (+216-9)
- (added) lld/test/COFF/duplicate-pdata-entry-arm64.yaml (+192)
- (added) lld/test/COFF/duplicate-pdata-entry.s (+218)
``````````diff
diff --git a/lld/COFF/ICF.cpp b/lld/COFF/ICF.cpp
index 69d339e3fc7cf..0b4cb9b1943d3 100644
--- a/lld/COFF/ICF.cpp
+++ b/lld/COFF/ICF.cpp
@@ -22,6 +22,9 @@
#include "Chunks.h"
#include "Symbols.h"
#include "lld/Common/Timer.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/xxhash.h"
@@ -39,9 +42,17 @@ class ICF {
void run();
private:
+ void recordPdataRefs();
void segregate(size_t begin, size_t end, bool constant);
- bool assocEquals(const SectionChunk *a, const SectionChunk *b);
+ bool sectionEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant);
+ bool pdataEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant);
+ bool describedPdataEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant);
+ bool assocEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant);
bool equalsConstant(const SectionChunk *a, const SectionChunk *b);
bool equalsVariable(const SectionChunk *a, const SectionChunk *b);
@@ -56,6 +67,7 @@ class ICF {
void forEachClass(std::function<void(size_t, size_t)> fn);
std::vector<SectionChunk *> chunks;
+ DenseMap<const SectionChunk *, SmallVector<SectionChunk *, 1>> pdataRefs;
int cnt = 0;
std::atomic<bool> repeat = {false};
@@ -75,7 +87,8 @@ class ICF {
// of the Visual C++ linker.
bool ICF::isEligible(SectionChunk *c) {
// Non-comdat chunks, dead chunks, and writable chunks are not eligible.
- bool writable = c->getOutputCharacteristics() & llvm::COFF::IMAGE_SCN_MEM_WRITE;
+ bool writable =
+ c->getOutputCharacteristics() & llvm::COFF::IMAGE_SCN_MEM_WRITE;
if (!c->isCOMDAT() || !c->live || writable)
return false;
@@ -100,6 +113,87 @@ bool ICF::isEligible(SectionChunk *c) {
return !c->keepUnique;
}
+static SectionChunk *getSectionChunk(Symbol *sym) {
+ if (auto *d = dyn_cast_or_null<Defined>(sym))
+ return dyn_cast_or_null<SectionChunk>(d->getChunk());
+ return nullptr;
+}
+
+static bool isPDataMachine(MachineTypes machine) {
+ return machine == AMD64 || machine == ARM64;
+}
+
+static size_t getPDataSize(MachineTypes machine) {
+ if (machine == ARM64)
+ return 8;
+ return 12;
+}
+
+static bool isPDataReloc(const coff_relocation &rel, MachineTypes machine) {
+ bool addr32 = machine == ARM64
+ ? rel.Type == llvm::COFF::IMAGE_REL_ARM64_ADDR32 ||
+ rel.Type == llvm::COFF::IMAGE_REL_ARM64_ADDR32NB
+ : rel.Type == llvm::COFF::IMAGE_REL_AMD64_ADDR32 ||
+ rel.Type == llvm::COFF::IMAGE_REL_AMD64_ADDR32NB;
+ return addr32 && rel.VirtualAddress < getPDataSize(machine) &&
+ rel.VirtualAddress % 4 == 0;
+}
+
+static const coff_relocation *findRelocAt(ArrayRef<coff_relocation> relocs,
+ uint32_t virtualAddress) {
+ for (const coff_relocation &rel : relocs)
+ if (rel.VirtualAddress == virtualAddress)
+ return &rel;
+ return nullptr;
+}
+
+static bool isPData(const SectionChunk *sc) {
+ return sc && isPDataMachine(sc->getMachine()) &&
+ sc->getSectionName().split('$').first == ".pdata";
+}
+
+void ICF::recordPdataRefs() {
+ for (Chunk *c : ctx.driver.getChunks()) {
+ auto *sc = dyn_cast<SectionChunk>(c);
+ if (!sc || !sc->live || !isPData(sc))
+ continue;
+
+ MachineTypes machine = sc->getMachine();
+
+ ArrayRef<coff_relocation> relocs = sc->getRelocs();
+ if (sc->getContents().size() != getPDataSize(machine))
+ continue;
+
+ const coff_relocation *beginRel = findRelocAt(relocs, 0);
+ if (!beginRel || !llvm::all_of(relocs, [&](const coff_relocation &rel) {
+ return isPDataReloc(rel, machine);
+ }))
+ continue;
+
+ SectionChunk *begin =
+ getSectionChunk(sc->file->getSymbol(beginRel->SymbolTableIndex));
+ if (!begin || !(begin->getOutputCharacteristics() &
+ llvm::COFF::IMAGE_SCN_MEM_EXECUTE))
+ continue;
+
+ pdataRefs[begin].push_back(sc);
+ }
+
+ for (auto &it : pdataRefs) {
+ llvm::stable_sort(it.second, [](const SectionChunk *a,
+ const SectionChunk *b) {
+ if (a->getSectionName() != b->getSectionName())
+ return a->getSectionName() < b->getSectionName();
+ ArrayRef<uint8_t> ac = a->getContents();
+ ArrayRef<uint8_t> bc = b->getContents();
+ if (!std::equal(ac.begin(), ac.end(), bc.begin(), bc.end()))
+ return std::lexicographical_compare(ac.begin(), ac.end(), bc.begin(),
+ bc.end());
+ return a < b;
+ });
+ }
+}
+
// Split an equivalence class into smaller classes.
void ICF::segregate(size_t begin, size_t end, bool constant) {
while (begin < end) {
@@ -126,8 +220,110 @@ void ICF::segregate(size_t begin, size_t end, bool constant) {
}
}
+bool ICF::sectionEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant) {
+ if (constant)
+ return equalsConstant(a, b);
+ return equalsVariable(a, b);
+}
+
+static bool isXData(const SectionChunk *sc) {
+ return sc && sc->getSectionName().split('$').first == ".xdata";
+}
+
+static bool sectionNamesEqual(const SectionChunk *a, const SectionChunk *b) {
+ if (isXData(a) || isXData(b))
+ return isXData(a) && isXData(b) &&
+ a->getSectionName().split('$').first ==
+ b->getSectionName().split('$').first;
+ return a->getSectionName() == b->getSectionName();
+}
+
+// On AMD64 and ARM64, .pdata contributes runtime-function table entries that
+// map code ranges to unwind data used by stack unwinding and EH dispatch. That
+// makes .pdata part of a function's semantic identity: two functions with
+// identical .text may still behave differently if their .pdata records refer to
+// different .xdata. Associative COMDAT children normally make that dependency
+// visible to ICF, but old MSVC-produced object files do not always associate
+// .xdata with the parent .text section. Follow .pdata relocations defensively so
+// folding is allowed only when the reachable unwind info is equivalent.
+bool ICF::pdataEquals(const SectionChunk *ap, const SectionChunk *bp,
+ bool constant) {
+ if (!isPData(ap) || !isPData(bp) || ap->getMachine() != bp->getMachine())
+ return false;
+
+ MachineTypes machine = ap->getMachine();
+ if (ap->getOutputCharacteristics() != bp->getOutputCharacteristics() ||
+ ap->getSectionName().split('$').first !=
+ bp->getSectionName().split('$').first ||
+ ap->header->SizeOfRawData != bp->header->SizeOfRawData ||
+ ap->checksum != bp->checksum || ap->getContents() != bp->getContents() ||
+ ap->getContents().size() != getPDataSize(machine))
+ return false;
+
+ ArrayRef<coff_relocation> ar = ap->getRelocs();
+ ArrayRef<coff_relocation> br = bp->getRelocs();
+ if (ar.size() != br.size())
+ return false;
+
+ auto eqSym = [&](Symbol *as, Symbol *bs) {
+ if (as == bs)
+ return true;
+
+ auto *ad = dyn_cast<DefinedRegular>(as);
+ auto *bd = dyn_cast<DefinedRegular>(bs);
+ if (!ad || !bd)
+ return false;
+
+ SectionChunk *ac = dyn_cast_or_null<SectionChunk>(ad->getChunk());
+ SectionChunk *bc = dyn_cast_or_null<SectionChunk>(bd->getChunk());
+ if (isXData(ac) || isXData(bc)) {
+ if (!ac || !bc || (constant && ad->getValue() != bd->getValue()))
+ return false;
+ return sectionEquals(ac, bc, constant);
+ }
+
+ if (constant && ad->getValue() != bd->getValue())
+ return false;
+ return ad->getChunk()->eqClass[cnt % 2] ==
+ bd->getChunk()->eqClass[cnt % 2];
+ };
+
+ for (size_t i = 0; i != ar.size(); ++i) {
+ if (!isPDataReloc(ar[i], machine) || ar[i].Type != br[i].Type ||
+ ar[i].VirtualAddress != br[i].VirtualAddress)
+ return false;
+
+ Symbol *as = ap->file->getSymbol(ar[i].SymbolTableIndex);
+ Symbol *bs = bp->file->getSymbol(br[i].SymbolTableIndex);
+ if (!eqSym(as, bs))
+ return false;
+ }
+
+ return true;
+}
+
+bool ICF::describedPdataEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant) {
+ auto ai = pdataRefs.find(a);
+ auto bi = pdataRefs.find(b);
+ if (ai == pdataRefs.end() || bi == pdataRefs.end())
+ return ai == pdataRefs.end() && bi == pdataRefs.end();
+
+ ArrayRef<SectionChunk *> ar = ai->second;
+ ArrayRef<SectionChunk *> br = bi->second;
+ if (ar.size() != br.size())
+ return false;
+
+ return std::equal(ar.begin(), ar.end(), br.begin(), br.end(),
+ [&](const SectionChunk *ap, const SectionChunk *bp) {
+ return pdataEquals(ap, bp, constant);
+ });
+}
+
// Returns true if two sections' associative children are equal.
-bool ICF::assocEquals(const SectionChunk *a, const SectionChunk *b) {
+bool ICF::assocEquals(const SectionChunk *a, const SectionChunk *b,
+ bool constant) {
// Ignore associated metadata sections that don't participate in ICF, such as
// debug info and CFGuard metadata.
auto considerForICF = [](const SectionChunk &assoc) {
@@ -139,7 +335,7 @@ bool ICF::assocEquals(const SectionChunk *a, const SectionChunk *b) {
auto rb = make_filter_range(b->children(), considerForICF);
return std::equal(ra.begin(), ra.end(), rb.begin(), rb.end(),
[&](const SectionChunk &ia, const SectionChunk &ib) {
- return ia.eqClass[cnt % 2] == ib.eqClass[cnt % 2];
+ return sectionEquals(&ia, &ib, constant);
});
}
@@ -149,6 +345,9 @@ bool ICF::equalsConstant(const SectionChunk *a, const SectionChunk *b) {
if (a->relocsSize != b->relocsSize)
return false;
+ if (isPData(a) || isPData(b))
+ return isPData(a) && isPData(b) && pdataEquals(a, b, true);
+
// Compare relocations.
auto eq = [&](const coff_relocation &r1, const coff_relocation &r2) {
if (r1.Type != r2.Type ||
@@ -162,7 +361,8 @@ bool ICF::equalsConstant(const SectionChunk *a, const SectionChunk *b) {
if (auto *d1 = dyn_cast<DefinedRegular>(b1))
if (auto *d2 = dyn_cast<DefinedRegular>(b2))
return d1->getValue() == d2->getValue() &&
- d1->getChunk()->eqClass[cnt % 2] == d2->getChunk()->eqClass[cnt % 2];
+ d1->getChunk()->eqClass[cnt % 2] ==
+ d2->getChunk()->eqClass[cnt % 2];
return false;
};
if (!std::equal(a->getRelocs().begin(), a->getRelocs().end(),
@@ -171,21 +371,26 @@ bool ICF::equalsConstant(const SectionChunk *a, const SectionChunk *b) {
// Compare section attributes and contents.
return a->getOutputCharacteristics() == b->getOutputCharacteristics() &&
- a->getSectionName() == b->getSectionName() &&
+ sectionNamesEqual(a, b) &&
a->header->SizeOfRawData == b->header->SizeOfRawData &&
a->checksum == b->checksum && a->getContents() == b->getContents() &&
- a->getMachine() == b->getMachine() && assocEquals(a, b);
+ a->getMachine() == b->getMachine() && assocEquals(a, b, true) &&
+ describedPdataEquals(a, b, true);
}
// Compare "moving" part of two sections, namely relocation targets.
bool ICF::equalsVariable(const SectionChunk *a, const SectionChunk *b) {
+ if (isPData(a) || isPData(b))
+ return isPData(a) && isPData(b) && pdataEquals(a, b, false);
+
// Compare relocations.
auto eqSym = [&](Symbol *b1, Symbol *b2) {
if (b1 == b2)
return true;
if (auto *d1 = dyn_cast<DefinedRegular>(b1))
if (auto *d2 = dyn_cast<DefinedRegular>(b2))
- return d1->getChunk()->eqClass[cnt % 2] == d2->getChunk()->eqClass[cnt % 2];
+ return d1->getChunk()->eqClass[cnt % 2] ==
+ d2->getChunk()->eqClass[cnt % 2];
return false;
};
auto eq = [&](const coff_relocation &r1, const coff_relocation &r2) {
@@ -201,7 +406,7 @@ bool ICF::equalsVariable(const SectionChunk *a, const SectionChunk *b) {
return std::equal(a->getRelocs().begin(), a->getRelocs().end(),
b->getRelocs().begin(), eq) &&
- assocEquals(a, b);
+ assocEquals(a, b, false) && describedPdataEquals(a, b, false);
}
// Find the first Chunk after Begin that has a different class from Begin.
@@ -258,6 +463,8 @@ void ICF::run() {
llvm::TimeTraceScope timeScope("ICF");
ScopedTimer t(ctx.icfTimer);
+ recordPdataRefs();
+
// Collect only mergeable sections and group by hash value.
uint32_t nextId = 1;
for (Chunk *c : ctx.driver.getChunks()) {
diff --git a/lld/test/COFF/duplicate-pdata-entry-arm64.yaml b/lld/test/COFF/duplicate-pdata-entry-arm64.yaml
new file mode 100644
index 0000000000000..1dada82605240
--- /dev/null
+++ b/lld/test/COFF/duplicate-pdata-entry-arm64.yaml
@@ -0,0 +1,192 @@
+# RUN: yaml2obj %s -o %t.obj
+#
+# ARM64 .pdata entries are two 32-bit fields: BeginAddress and UnwindData.
+# The helper functions have identical code bytes, but their live .pdata records
+# point to different .xdata records. ICF must keep the helpers separate, so both
+# .pdata records remain live.
+#
+# RUN: lld-link %t.obj -dll -noentry -out:%t.dll -verbose 2>&1 | FileCheck --check-prefix=ICF-LOG --implicit-check-not="duplicate .pdata entry" %s
+# RUN: llvm-readobj --sections %t.dll | FileCheck --check-prefix=ICF %s
+# ICF-LOG: ICF needed
+# ICF: Name: .text
+# ICF-NEXT: VirtualSize: 0x14
+# ICF: Name: .pdata
+# ICF-NEXT: VirtualSize: 0x10
+#
+# RUN: lld-link %t.obj -dll -noentry -out:%t_noicf.dll -opt:noicf
+# RUN: llvm-readobj --sections %t_noicf.dll | FileCheck --check-prefix=NOICF %s
+# NOICF: Name: .text
+# NOICF-NEXT: VirtualSize: 0x14
+# NOICF: Name: .pdata
+# NOICF-NEXT: VirtualSize: 0x10
+
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_ARM64
+ Characteristics: []
+sections:
+ - Name: '.text$parent_a'
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: C0035FD6
+ - Name: '.text$parent_b'
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: 1F2003D5C0035FD6
+ - Name: '.text$helper'
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: C0035FD6
+ - Name: '.text$helper'
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: C0035FD6
+ - Name: .xdata
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: '01000000'
+ - Name: .xdata
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: '02000000'
+ - Name: '.pdata$parent_a'
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: '0000000000000000'
+ Relocations:
+ - VirtualAddress: 0
+ SymbolName: helper_a
+ Type: IMAGE_REL_ARM64_ADDR32NB
+ - VirtualAddress: 4
+ SymbolName: xdata_sym
+ Type: IMAGE_REL_ARM64_ADDR32NB
+ - Name: '.pdata$parent_b'
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: '0000000000000000'
+ Relocations:
+ - VirtualAddress: 0
+ SymbolName: helper_b
+ Type: IMAGE_REL_ARM64_ADDR32NB
+ - VirtualAddress: 4
+ SymbolName: xdata_b_sym
+ Type: IMAGE_REL_ARM64_ADDR32NB
+ - Name: .drectve
+ Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+ SectionData: 202D6578706F72743A706172656E745F61202D6578706F72743A706172656E745F62
+symbols:
+ - Name: '.text$parent_a'
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 4
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 1111111111
+ Number: 1
+ Selection: IMAGE_COMDAT_SELECT_ANY
+ - Name: parent_a
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+ - Name: '.text$parent_b'
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 8
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 2222222222
+ Number: 2
+ Selection: IMAGE_COMDAT_SELECT_ANY
+ - Name: parent_b
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+ - Name: '.text$helper'
+ Value: 0
+ SectionNumber: 3
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 4
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 3333333333
+ Number: 3
+ Selection: IMAGE_COMDAT_SELECT_ANY
+ - Name: helper_a
+ Value: 0
+ SectionNumber: 3
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+ - Name: '.text$helper'
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 4
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 3333333333
+ Number: 4
+ Selection: IMAGE_COMDAT_SELECT_ANY
+ - Name: helper_b
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+ - Name: xdata_sym
+ Value: 0
+ SectionNumber: 5
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: xdata_b_sym
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: '.pdata$parent_a'
+ Value: 0
+ SectionNumber: 7
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 8
+ NumberOfRelocations: 2
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 1
+ Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE
+ - Name: '.pdata$parent_b'
+ Value: 0
+ SectionNumber: 8
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 8
+ NumberOfRelocations: 2
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 2
+ Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE
+...
diff --git a/lld/test/COFF/duplicate-pdata-entry.s b/lld/test/COFF/duplicate-pdata-entry.s
new file mode 100644
index 0000000000000..a87ddad636afc
--- /dev/null
+++ b/lld/test/COFF/duplicate-pdata-entry.s
@@ -0,0 +1,2...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/205456
More information about the llvm-commits
mailing list