[PATCH] D157136: [LLD][COFF] Handle 'label' symbols when they point to a COMDAT section

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 20:44:07 PDT 2023


aganea added a comment.

Sorry I will answer to your comments a bit later. I was trying to understand the root issue, and I've managed to reproduce it locally.

The problem is not MSVC, but the way the packaging <https://github.com/firebase/firebase-cpp-sdk/blob/main/scripts/merge_libraries.py#L713> is done in firebase-sdk. Namely, it uses binutils `objcopy` which doesn't seem to understand COMDAT relationships (that is, `IMAGE_COMDAT_SELECT_ASSOCIATIVE`). Simply replacing by `llvm-objcopy` fixes the issue.

I'm also wondering if instead of this patch, we couldn't craft something simpler, an heuristic that "fixes" the section header and the section symbol. Usually they seems to come in a pair, `.text$mn`, `.text$x` or a trio if debug symbols are involved: `.text$mn`, `.debug$S`, `.text$x`. Opinions?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157136/new/

https://reviews.llvm.org/D157136



More information about the llvm-commits mailing list