Skip to content

Relocate prefixes split across x86-64 operands - #24080

Merged
MikeMcQuaid merged 1 commit into
mainfrom
relocate-split-prefixes
Sep 23, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
relocate-split-prefixes

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Rewrite complete movabs prefix operands in ELF executable sections with separator padding to preserve instruction and suffix offsets.
  • Find split prefixes omitted from older bottle metadata and preserve hardlinks when rewriting affected files.

Fixes #24074


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Codex with GPT 6 Astra at Extra High effort, with local review and testing.


- Rewrite complete `movabs` prefix operands in ELF executable sections
  with separator padding to preserve instruction and suffix offsets.
- Find split prefixes omitted from older bottle metadata and preserve
  hardlinks when rewriting affected files.
- Share instruction encodings between discovery and rewriting to keep
  their matching rules consistent.

Fixes #24074
Copilot AI lite review requested due to automatic review settings September 23, 2026 19:25

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Unresolved relocation correctness and malformed-ELF handling issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Updates ELF binary relocation to handle x86-64 prefixes split across movabs operands while preserving offsets and hardlinks.

Changes:

  • Rewrites split prefixes in executable ELF sections.
  • Expands candidate discovery and preserves hardlinks.
  • Adds regression tests and updates bottle compatibility documentation.
File Summary
Library/​Homebrew/​test/​keg_relocate/​binary_relocation_spec.rb Adds relocation, architecture, section, and hardlink coverage.
Library/​Homebrew/​keg_relocate.rb Implements split-prefix detection and relocation; has one critical and three moderate unresolved findings.
docs/​Bottles.md Documents prefix and cellar compatibility requirements.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/keg_relocate.rb Resolved
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit 13b273a Sep 23, 2026
53 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the relocate-split-prefixes branch September 23, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken path rewrite in binary relocation for custom prefixes

3 participants

⌂ 换网址