[PATCH] ld/pdb: Make globals hash ordering deterministic

Project / Subsystem

binutils / ld/pdb

Date

2026-09-30

Proposer

Oleg Tolmatcev <oleg.tolmatcev@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Slightly increases the complexity of the comparison function, but ensures consistent output.

All attributes

project
binutils
subsystem
ld/pdb
patch_id
—
discussion_id
20260930193657.733-6-oleg.tolmatcev@gmail.com
source_type
public_inbox
title
[PATCH] ld/pdb: Make globals hash ordering deterministic
headline
ld/pdb: Make global hash ordering deterministic
tldr
Ensures deterministic ordering of global symbols in PDB files by sorting on offset for hash collisions.
proposer
Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Slightly increases the complexity of the comparison function, but ensures consistent output.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • pdb
  • • linker
  • • reproducibility
  • • bugfix
bugzilla_url
—
date
2026-09-30T00:00:00.000Z

[PATCH] ld/pdb: Make globals hash ordering deterministic

This patch makes the ordering of global symbols within PDB files deterministic by introducing a secondary sort key. Previously, when multiple global symbols had the same hash value, their relative order was left to the host system’s qsort implementation, leading to inconsistencies. The change modifies the global_compare_hash function to use the symbol’s record offset as a tie-breaker, ensuring reproducible PDB output across different platforms.