[PATCH 4/4] bfd: pe: Introduce COFF_WITH_pe32plus define

Project / Subsystem

binutils / bfd

Date

2026-09-13

Proposer

Jon Turney <jon.turney@dronecode.org.uk>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Improves code readability and maintainability by centralizing PE32+ format checks.
  • • Reduces the potential for errors in conditional logic related to PE file formats.

All attributes

project
binutils
subsystem
bfd
patch_id
—
discussion_id
20260913123323.9734-5-jon.turney@dronecode.org.uk
source_type
public_inbox
title
[PATCH 4/4] bfd: pe: Introduce COFF_WITH_pe32plus define
headline
bfd: pe: Introduce COFF_WITH_pe32plus define
tldr
Define COFF_WITH_pe32plus for PE32+ formats to simplify conditional logic.
proposer
Jon Turney <jon.turney@dronecode.org.uk>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Improves code readability and maintainability by centralizing PE32+ format checks.
  • • Reduces the potential for errors in conditional logic related to PE file formats.
series_id
binutils:bfd: pe: introduce coff_with_pe32plus define
series_role
reply
series_parts
[]
tags
  • • bfd
  • • pe
  • • refactoring
  • • maintainability
bugzilla_url
—
date
2026-09-13T00:00:00.000Z

[PATCH 4/4] bfd: pe: Introduce COFF_WITH_pe32plus define

This patch introduces a new preprocessor macro, COFF_WITH_pe32plus, to consolidate checks for PE32+ (64-bit) formats within bfd/peXXigen.c. This aims to replace error-prone, long lists of specific format defines with a single, clearer indicator, making the code more maintainable and reducing the likelihood of errors when handling PE32/PE32+ differences.