Skip to content

radlink: prefer non-zero function prefixes for COMDAT Any - #939

Open
honkstar1 wants to merge 1 commit into
EpicGames:devfrom
honkstar1:codex/radlink-comdat-prefix-pr
Open

radlink: prefer non-zero function prefixes for COMDAT Any#939
honkstar1 wants to merge 1 commit into
EpicGames:devfrom
honkstar1:codex/radlink-comdat-prefix-pr

Conversation

@honkstar1

Copy link
Copy Markdown

Summary

Prefer COMDAT Any definitions with non-zero prefix data over definitions with no prefix or an all-zero prefix. LLVM places prefix data before the function entry point, whose COFF symbol value gives the prefix length. AutoRTFM uses this data to find the closed function variant; selecting an uninstrumented duplicate can discard that information.

  • Inspect only bytes before the symbol, reject out-of-range prefix lengths, and ignore uninitialized section data.
  • Preserve deterministic input-order selection when both candidates have the same prefix status. Handle both replacement directions, since insertion order need not match input order.
  • Leave Null, Largest, SameSize, and Any/Largest promotion unchanged.
  • Add 44 regression combinations covering both input orders, 1/4 workers, zero/non-zero prefixes, invalid lengths, and unaffected selection modes.

This is a standalone change against dev (47de6bf), not a restacking of the existing optimization PRs.

Validation

  • Clang/LLD 20.1.8 release (-O2) build.
  • New regression fails with unmodified dev and passes with this change.
  • Upstream linker suite: 141 passed, 0 failed/crashed, 1 excluded. import_export fails its export-offset assertion both before and after this patch in this environment; the baseline failure was reproduced separately.
  • Deployment-baseline backport: 47a6150f, preserving the previously submitted 348ae713 stack. Oodle-enabled optimized build: 181 passed, 0 failed/crashed, 1 excluded in the linker/torture/base/eval2 selection. The excluded case is ms_link_icf_section_flag_eligibility, a Microsoft-linker comparison. Debugger and RDI suites were not part of that selection.
  • The new regression also fails with the actual previously submitted 348ae713 binary.

No production binaries have been replaced, and no Engine/runtime or farm soak result is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant