We're getting asserts for duplicate section registration during
linking which stems back to these sections. From previous
discussions, it seems like these are metadata sections that can
be dropped. See the discussion in D116474 and
https://bugs.llvm.org/show_bug.cgi?id=45111.
Details
- Reviewers
lhames sunho - Commits
- rG639e411c0203: [Orc][Coff] Skip registration of voltbl sections
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
If I understand the bug reports / docs correctly (I only had time to skim them) we probably want a principled fix for duplicate and metadata sections in the long term.
If that's right then I'm happy for this fix to land in the short term, but we should probably file a follow-up issue and add a FIXME.
@sunho -- Have you come across these sections before?
I haven't gotten this before, but it looks safe to skip it looking at the discussion. We wouldn't want to do it inside orc runtime tho. We can skip it around here: https://github.com/llvm/llvm-project/blob/main/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp#L139
Nice, thanks for the pointer. I'll move the check to there.
For reference, we can't even load the coff platform right now (running vs2022) because it asserts immediately.
@sunho Is there a good reference for using the coff platform? Right now I'm not quite sure what's the best place to look at for usage inspiration. Thanks a lot for the review!
coff platform just landed last year, so it can be quite cranky. It is stable enough to link basic microsoft STL or capstone disassembler obj files but these are only real world applications I tested out. Please let me know if there's any issue.
Regarding how to use it, llvm-jitlink has some usage of coff platform. https://github.com/llvm/llvm-project/blob/2adf9c9f502acacf3b846cbf64d8a4739c803de6/llvm/tools/llvm-jitlink/llvm-jitlink.cpp#L1011 You can also use ExecutorNativePlatform if you're using LLJIT.