Skip to content

Reland "Make symbol table order deterministic (#1263)"#1432

Merged
quic-areg merged 1 commit into
qualcomm:mainfrom
quic-areg:deterministic-symtab
Jul 24, 2026
Merged

Reland "Make symbol table order deterministic (#1263)"#1432
quic-areg merged 1 commit into
qualcomm:mainfrom
quic-areg:deterministic-symtab

Conversation

@quic-areg

@quic-areg quic-areg commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Multithreaded relocation scanning made the order in which symbols were appended to the module symbol vector dependent on thread timing. Both .dynsym and .symtab inherited that order: existing sorts had address ties everywhere, and stable_sort fell back to the unpredictable insertion order.

Sort each table deterministically by (input ordinal, input .symtab index).

Also fixes a latent bug where an absolute symbol was not counted as
global for computing sh_info.

Fixes #1261.

This relands 257cefc, which was reverted in 3e0b10c.

@quic-areg
quic-areg force-pushed the deterministic-symtab branch from 64824c9 to 76659c9 Compare July 16, 2026 19:04
@quic-areg
quic-areg marked this pull request as ready for review July 17, 2026 20:23
@quic-areg
quic-areg force-pushed the deterministic-symtab branch from 76659c9 to d2e673d Compare July 17, 2026 20:24
@quic-areg
quic-areg force-pushed the deterministic-symtab branch from d2e673d to a12e175 Compare July 21, 2026 16:24
@quic-areg
quic-areg force-pushed the deterministic-symtab branch from a12e175 to 6672b48 Compare July 23, 2026 17:40
@quic-areg quic-areg added the zephyr-check Run Zephyr build/check workflow on this PR label Jul 23, 2026
@quic-areg
quic-areg force-pushed the deterministic-symtab branch 2 times, most recently from d8c1191 to f669dde Compare July 23, 2026 19:35
Comment thread lib/Fragment/DynSymFragment.cpp
Comment thread lib/Target/GNULDBackend.cpp
Comment thread lib/Fragment/DynSymFragment.cpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please raise tickets for follow up.

Multithreaded relocation scanning made the order in which symbols were
appended to the module symbol vector dependent on thread timing. Both
.dynsym and .symtab inherited that order: existing sorts had address
ties everywhere, and stable_sort fell back to the unpredictable insertion
order.

Sort each table deterministically by (input ordinal, input .symtab index).

Also fixes a latent bug where an absolute symbol was not counted as
global for computing sh_info.

Fixes qualcomm#1261.

This relands 257cefc, which was reverted
in 3e0b10c.

Signed-off-by: quic-areg <aregmi@qti.qualcomm.com>
@quic-areg
quic-areg force-pushed the deterministic-symtab branch from f669dde to 4817640 Compare July 24, 2026 21:04
quic-areg added a commit to quic-areg/eld that referenced this pull request Jul 24, 2026
Follow-up to qualcomm#1432 which introduces a deterministic symbol table
order.

Signed-off-by: quic-areg <aregmi@qti.qualcomm.com>
@quic-areg
quic-areg merged commit cb19066 into qualcomm:main Jul 24, 2026
12 checks passed
Shankar Easwaran (quic-seaswara) pushed a commit that referenced this pull request Jul 24, 2026
Follow-up to #1432 which introduces a deterministic symbol table
order.

Signed-off-by: quic-areg <aregmi@qti.qualcomm.com>
@quic-areg
quic-areg deleted the deterministic-symtab branch July 24, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zephyr-check Run Zephyr build/check workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix non-deterministic order of entries in .dynsym

3 participants