[PATCH] D129941: [JITLink][COFF] Implement IMAGE_COMDAT_SELECT_LARGEST partially.
Sunho Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 02:06:32 PDT 2022
sunho updated this revision to Diff 445741.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129941/new/
https://reviews.llvm.org/D129941
Files:
llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_largest.test
Index: llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_largest.test
===================================================================
--- llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_largest.test
+++ llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_largest.test
@@ -1,10 +1,14 @@
# REQUIRES: asserts
-# XFAIL: *
# RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1
#
-# Check jitlink return an error when IMAGE_COMDAT_SELECT_LARGEST selection type is encountered.
+# Check jitlink handles largest selection type as plain weak symbol.
#
+# CHECK: Creating graph symbols...
+# CHECK: 2: Creating defined graph symbol for COFF symbol ".text" in .text (index: 2)
+# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000001, linkage: strong, scope: local, dead - <anonymous symbol>
+# CHECK-NEXT: 4: Exporting COMDAT graph symbol for COFF symbol "func" in section 2
+# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000001, linkage: weak, scope: default, dead - func
--- !COFF
header:
Index: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
+++ llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
@@ -482,10 +482,16 @@
break;
}
case COFF::IMAGE_COMDAT_SELECT_LARGEST: {
- // FIXME: Support IMAGE_COMDAT_SELECT_LARGEST when LinkGraph is able to
- // handle this.
- return make_error<JITLinkError>(
- "IMAGE_COMDAT_SELECT_LARGEST is not supported.");
+ // FIXME: Support IMAGE_COMDAT_SELECT_LARGEST properly when LinkGraph is
+ // able to handle this.
+ LLVM_DEBUG({
+ dbgs() << " " << SymIndex
+ << ": Partially supported IMAGE_COMDAT_SELECT_LARGEST was used"
+ " in section "
+ << Symbol.getSectionNumber() << "\n";
+ });
+ L = Linkage::Weak;
+ break;
}
case COFF::IMAGE_COMDAT_SELECT_NEWEST: {
// Even link.exe doesn't support this selection properly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129941.445741.patch
Type: text/x-patch
Size: 2067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220719/ee466f2d/attachment.bin>
More information about the llvm-commits
mailing list