[PATCH] D103971: [lld-macho] Don't check for flag-mismatch if flag isn't set.

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 09:14:18 PDT 2021


oontvoo created this revision.
Herald added a reviewer: int3.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
oontvoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Details:
I've been getting a few weird errors similar to the following from our internal tests:

  ld64.lld.darwinnew: error: Cannot merge section __eh_frame (type=0x0) into __eh_frame (type=0xB): inconsistent types
  ld64.lld.darwinnew: error: Cannot merge section __eh_frame (flags=0x0) into __eh_frame (flags=0x6800000B): strict flags differ
  ld64.lld.darwinnew: error: Cannot merge section __eh_frame (type=0x0) into __eh_frame (type=0xB): inconsistent types
  ld64.lld.darwinnew: error: Cannot merge section __eh_frame (flags=0x0) into __eh_frame (flags=0x6800000B): strict flags differ


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103971

Files:
  lld/MachO/ConcatOutputSection.cpp


Index: lld/MachO/ConcatOutputSection.cpp
===================================================================
--- lld/MachO/ConcatOutputSection.cpp
+++ lld/MachO/ConcatOutputSection.cpp
@@ -348,7 +348,7 @@
 
   constexpr uint32_t strictFlags = S_ATTR_DEBUG | S_ATTR_STRIP_STATIC_SYMS |
                                    S_ATTR_NO_DEAD_STRIP | S_ATTR_LIVE_SUPPORT;
-  if ((input->flags ^ flags) & strictFlags)
+  if (input->flags && ((input->flags ^ flags) & strictFlags))
     error("Cannot merge section " + input->name + " (flags=0x" +
           to_hexString(input->flags) + ") into " + name + " (flags=0x" +
           to_hexString(flags) + "): strict flags differ");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103971.350919.patch
Type: text/x-patch
Size: 673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210609/7f4e3570/attachment.bin>


More information about the llvm-commits mailing list