Repository navigation
feat(native): resolve RISC-V ELF initializer pointers - #12068
ShuaixinHuang wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The change affects native ELF initializer inspection across its existing entry points. The focused acceptance test must follow the required contract-import rule before merging; no new code defect was found. Findings
Fix with agent prompt### Issue 1
tests/acceptance/riscvNativeInitializersCli.test.ts:undefined-5
This single-tool test imports `toolContracts.ts`, which loads every contract family. The testing guide requires focused tests to import their named contract family and reserves the full catalog for catalog-wide checks. Import `BINARY_DIAGNOSTICS_TOOL_CONTRACTS` and select `inspect_native_initializers` by name instead. This avoids unrelated setup work and dependencies.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds RV32/RV64 initializer pointer decoding through the shared ELF reader.
This review used source inspection; tests were not rerun. Checking whether another PR supersedes this one was blocked by unavailable GitHub authentication. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Class["ELF machine and word size"] --> Profiles["Shared relocation profiles"]
Fixed["Fixed REL/RELA, APS2 and RELR"] --> Dynamic["Dynamic relocation reader"]
Profiles --> Dynamic
Profiles --> Sections["Section relocation reader"]
Records["Section REL/RELA"] --> Sections
Dynamic --> Slots["Initializer targets and names"]
Sections --> Slots
Slots --> Report["CLI / MCP report"]
Reviews (3) · Last reviewed commit: "feat(native): resolve RISC-V ELF initial..." · Reviewed by Greptile |
| import { readFile, writeFile } from "node:fs/promises"; | ||
| import { join } from "node:path"; | ||
| import { expect } from "vitest"; | ||
| import { toolContract } from "../../src/contracts/toolContracts.js"; |
There was a problem hiding this comment.
Focused test loads every contract. This single-tool test imports
toolContracts.ts, which loads every contract family. The testing guide requires focused tests to import their named contract family and reserves the full catalog for catalog-wide checks. Import BINARY_DIAGNOSTICS_TOOL_CONTRACTS and select inspect_native_initializers by name instead. This avoids unrelated setup work and dependencies.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/acceptance/riscvNativeInitializersCli.test.ts
Line: 5
Comment:
**Focused test loads every contract.** This single-tool test imports `toolContracts.ts`, which loads every contract family. The testing guide requires focused tests to import their named contract family and reserves the full catalog for catalog-wide checks. Import `BINARY_DIAGNOSTICS_TOOL_CONTRACTS` and select `inspect_native_initializers` by name instead. This avoids unrelated setup work and dependencies.
**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Replaces #12041 against main 8a10fa9.
Carry the class-aware RV32/RV64 relocation profiles and TLS offset fix onto the shared fixed/APS2 relocation path. Imported pointers remain unresolved, and TLS offsets supply neither an initializer address nor an address name.
Validation
Author readiness
Human owner: @ShuaixinHuang