https://sourceware.org/bugzilla/show_bug.cgi?id=19254
Bug ID: 19254 Summary: "too many sections" when linking COFF executables Product: binutils Version: 2.25 Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: olsner at gmail dot com Target Milestone: --- When linking an executable out of many object files with many sections, it seems that if the total number of input sections is larger than COFF/PE's maximum the linking fails. I would expect those sections to get merged together into a single .text section (and .data etc), and so the final executable should have much less than 32k sections and not risk hitting the limit. I'm guessing the section number limit is checked when loading everything in, before the linker script gets to merge sections? The objective was to use --gc-sections (e.g. with -ffunction-sections, though in this case actually https://ghc.haskell.org/trac/ghc/ticket/8405), but I don't think that is actually relevant to the problem. Even if you don't GC sections, they should get merged when linking executables as I understand it. This was using binutils 2.25.1 on mingw/x86_64. -- 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