Skip to content

fix(macho): support intel mac dylibs in find_section_in_current_image - #74

Merged
littledivy merged 1 commit into
denoland:mainfrom
jlarmstrongiv:claude/ecstatic-volta-mmkyya
Jul 2, 2026
Merged

fix(macho): support intel mac dylibs in find_section_in_current_image#74
littledivy merged 1 commit into
denoland:mainfrom
jlarmstrongiv:claude/ecstatic-volta-mmkyya

Conversation

@jlarmstrongiv

@jlarmstrongiv jlarmstrongiv commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This PR is an example implementation with Claude. Proceed with caution or ignore entirely. Closes #73


On x86_64 macOS, write_section appends the payload past __LINKEDIT behind a <sui-data> sentinel instead of creating a real Mach-O section, so getsectiondata cannot find it. The previous find_section_in_current_image stub returned Ok(None), breaking embedded data lookups from dylibs (e.g. deno desktop's denort dylib on Intel Macs).

Refactor intel_mac::find_section into a path-taking helper and resolve the current image's file via dladdr, mirroring how the aarch64 branch already locates its own image.

On x86_64 macOS, write_section appends the payload past __LINKEDIT
behind a <~sui-data~> sentinel instead of creating a real Mach-O
section, so getsectiondata cannot find it. The previous
find_section_in_current_image stub returned Ok(None), breaking embedded
data lookups from dylibs (e.g. deno desktop's denort dylib on Intel
Macs).

Refactor intel_mac::find_section into a path-taking helper and resolve
the current image's file via dladdr, mirroring how the aarch64 branch
already locates its own image.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.79%. Comparing base (307b58c) to head (d6ea8e6).

Files with missing lines Patch % Lines
intel_mac.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
- Coverage   72.00%   71.79%   -0.21%     
==========================================
  Files           3        3              
  Lines        1036     1039       +3     
==========================================
  Hits          746      746              
- Misses        290      293       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@littledivy
littledivy merged commit 4ecf93d into denoland:main Jul 2, 2026
4 checks passed
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.

find_section_in_current_image Intel Mac Support

4 participants