[llvm-bugs] [Bug 52330] New: lld/mac crashes when ICFing code with undefs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 27 11:21:51 PDT 2021


            Bug ID: 52330
           Summary: lld/mac crashes when ICFing code with undefs
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

I noticed this in .s form while working on PR51999 (not caused by the fix
there). Turns out it's easy to hit from .c files too:

% cat foo.c
void g();
int main() { g(); }

% out/gn/bin/clang foo.c -fuse-ld=lld -Wl,--icf=all --target=arm64-apple-macos
-isysroot $(xcrun -show-sdk-path -sdk macosx) -fno-exceptions
foldIdenticalSections symbol kind
UNREACHABLE executed at ../../lld/MachO/ICF.cpp:250!

We shouldn't crash here but emit an "undefined symbol" error instead.

(I'll take a look.)

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211027/3c5e63bd/attachment.html>

More information about the llvm-bugs mailing list