https://sourceware.org/bugzilla/show_bug.cgi?id=21274

            Bug ID: 21274
           Summary: ld segfaults linking PE DLL
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: kyrab at mail dot ru
  Target Milestone: ---

Created attachment 9907
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9907&action=edit
patch

`ld` segfaults when linking C++ PE DLL.

The culprit is pretty much trivial: `pe_create_import_fixup` uses fixed-sized
buffer to create mangled names, but this buffer is too small (300 bytes) and is
easily overflowed by long mangled names.

Quick patch is attached. I bumped the size of the buffer to more sane 2048
bytes. Since `gcc` doesn't limit identifier length, a proper fix would be
slightly more involved, but I didn't bother with it, sorry.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to