[PR #807] [CLOSED] fix(native): retain nm-proven literal export names #2254

Closed
opened 2026-10-16 21:16:19 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/807
Author: @rudycelekli
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/dyld-export-literal-names-20261006


📝 Commits (1)

  • d242633 fix(native): retain nm-proven literal export names

📊 Changes

3 files changed (+77 additions, -7 deletions)

View changed files

📝 src/native/NativeMachoInspection.ts (+3 -4)
📝 src/native/parsers/dyldInfo.ts (+15 -3)
📝 tests/boundary/providers/native/nativeInventory.golden.test.ts (+59 -0)

📄 Description

Summary

Use the exact export names captured by the same inspection's nm command to distinguish literal bracket suffixes from dyld annotations. A valid Clang asm symbol named symbol [weak-def] currently creates an invented weak export symbol, while the actual full name loses its address in the nm fallback.

Where nm establishes the full literal name only, preserve that identity and its dyld address. Where nm establishes both the short and full names, keep their exact nm identities and leave the ambiguous row's address/flags unknown. Annotation parsing without nm evidence, imports and reexports retain their existing behavior.

Validation

  • Actual Clang-built Mach-O dylib and public NativeMacOSProvider.inspect_macho: the literal-name case reports four exports for the actual three before; after it reports the exact three and preserves the real weak-export control.
  • A second real dylib exports both interpretations. After, both exact names remain, with ambiguous address/weak fields null rather than guessed.
  • 27 focused native parser/provider tests pass.
  • Exact signed head npm run check passes (129 existing warnings, zero errors); npm run check:fast passes.

Native proof is macOS arm64 with Apple's Clang/dyld_info/nm. Exports retain their existing incomplete-coverage declaration; no Hopper/Ghidra or other OS coverage is claimed. Hosted CI is separate. No schema changes.

AI assistance was used for investigation, implementation and tests; I reviewed the source and native results.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/807 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/dyld-export-literal-names-20261006` --- ### 📝 Commits (1) - [`d242633`](https://github.com/morluto/rea/commit/d242633b839c59ccf73552be7fa0c93ec4f0699c) fix(native): retain nm-proven literal export names ### 📊 Changes **3 files changed** (+77 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/native/NativeMachoInspection.ts` (+3 -4) 📝 `src/native/parsers/dyldInfo.ts` (+15 -3) 📝 `tests/boundary/providers/native/nativeInventory.golden.test.ts` (+59 -0) </details> ### 📄 Description ## Summary Use the exact export names captured by the same inspection's `nm` command to distinguish literal bracket suffixes from dyld annotations. A valid Clang asm symbol named `symbol [weak-def]` currently creates an invented weak export `symbol`, while the actual full name loses its address in the nm fallback. Where nm establishes the full literal name only, preserve that identity and its dyld address. Where nm establishes both the short and full names, keep their exact nm identities and leave the ambiguous row's address/flags unknown. Annotation parsing without nm evidence, imports and reexports retain their existing behavior. ## Validation - Actual Clang-built Mach-O dylib and public `NativeMacOSProvider.inspect_macho`: the literal-name case reports four exports for the actual three before; after it reports the exact three and preserves the real weak-export control. - A second real dylib exports both interpretations. After, both exact names remain, with ambiguous address/weak fields null rather than guessed. - 27 focused native parser/provider tests pass. - Exact signed head `npm run check` passes (129 existing warnings, zero errors); `npm run check:fast` passes. Native proof is macOS arm64 with Apple's Clang/dyld_info/nm. Exports retain their existing incomplete-coverage declaration; no Hopper/Ghidra or other OS coverage is claimed. Hosted CI is separate. No schema changes. AI assistance was used for investigation, implementation and tests; I reviewed the source and native results. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:16:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2254
No description provided.