Re: [PATCH v4] PE/COFF: raise normal PE section limit safely
Project / Subsystem
binutils / pe/coff
Date
2026-07-17
Proposer
Jan Beulich <jbeulich@suse.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • Increasing the section limit improves compatibility with modern compilers but requires careful handling of signed/unsigned conversions to avoid breaking existing reserved values.
- • The change benefits users creating very large executables or libraries with many sections.
All attributes
- project
- binutils
- subsystem
- pe/coff
- patch_id
- —
- discussion_id
- 71e08b2d-715a-4cb4-941e-7e548c4b264c@suse.com
- source_type
- public_inbox
- title
- Re: [PATCH v4] PE/COFF: raise normal PE section limit safely
- headline
- PE/COFF: raise normal PE section limit safely
- tldr
- Patch to safely increase the maximum number of sections in PE/COFF files from 32767 to 65279 is reviewed positively.
- proposer
- Jan Beulich <jbeulich@suse.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • Increasing the section limit improves compatibility with modern compilers but requires careful handling of signed/unsigned conversions to avoid breaking existing reserved values.
- • The change benefits users creating very large executables or libraries with many sections.
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • binutils
- • PE/COFF
- • sections
- • Windows
- • portability
- bugzilla_url
- —
- date
- 2026-07-17T00:00:00.000Z
Re: [PATCH v4] PE/COFF: raise normal PE section limit safely
This discussion confirms a positive review for a patch that safely increases the maximum number of sections allowed in normal PE/COFF files. The current limit of 32,767 sections is due to binutils using a signed 16-bit integer for symbol section numbers, whereas compilers like MSVC and Clang support a larger unsigned range up to 65,279. The patch modifies binutils to correctly handle this larger unsigned range for normal PE symbol section numbers while preserving reserved values for special symbols. A new gas test case is also added to verify this functionality.