[PATCH] ld: testsuite: Fix integer overflow in ld/testsuite/ld-elf/init-mixed.c.

Project / Subsystem

binutils / ld

Date

2026-07-17

Proposer

Jan Dubiec <jdx@o2.pl>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Using `int32_t` ensures type safety and portability but might be slightly less performant than a native `int` on platforms where `int` is already 32 bits.
  • The fix addresses a test case, so its direct impact on end-users is minimal, but it improves the reliability of the test suite.

All attributes

project
binutils
subsystem
ld
patch_id
discussion_id
20260717161204.1022216-1-jdx@o2.pl
source_type
public_inbox
title
[PATCH] ld: testsuite: Fix integer overflow in ld/testsuite/ld-elf/init-mixed.c.
headline
ld: testsuite: Fix integer overflow in ld/testsuite/ld-elf/init-mixed.c.
tldr
Fixes an integer overflow in an ld test case by using a fixed-width integer type.
proposer
Jan Dubiec <jdx@o2.pl>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Using `int32_t` ensures type safety and portability but might be slightly less performant than a native `int` on platforms where `int` is already 32 bits.
  • The fix addresses a test case, so its direct impact on end-users is minimal, but it improves the reliability of the test suite.
series_id
series_role
standalone
series_parts
[]
tags
  • binutils
  • ld
  • testing
  • overflow
  • portability
bugzilla_url
date
2026-07-17T00:00:00.000Z

[PATCH] ld: testsuite: Fix integer overflow in ld/testsuite/ld-elf/init-mixed.c.

A patch addresses an integer overflow vulnerability in the ld/testsuite/ld-elf/init-mixed.c test file. The issue arises because the code assumes that int is 32 bits wide, which is not guaranteed across all platforms. The fix replaces the int count variable with int32_t to ensure a consistent 32-bit width, thus preventing potential overflows.