[PR #1974] [MERGED] test(ghidra): require pending multi-HI16 coverage in the real MIPS relocatable lane #4941

Closed
opened 2026-10-31 00:57:12 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1974
Author: @AurelioB
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: test/mips-relocatable-multiple-hi16


📝 Commits (2)

  • 56fdfe6 test(ghidra): require pending multi-HI16 coverage in the real MIPS relocatable lane
  • 6c58f89 test(ghidra): make the MIPS multi-HI16 fixture independent of relocation sorting

📊 Changes

3 files changed (+29 additions, -3 deletions)

View changed files

📝 docs/ghidra-mips.md (+4 -2)
📝 scripts/verify-real-ghidra-mips-relocatable.mjs (+1 -0)
📝 tests/conformance/c/mips-relocatable.c (+24 -1)

📄 Description

Follow-up to #1950, addressing the post-merge Codex review comment on scripts/verify-real-ghidra-mips-relocatable.mjs.

Problem

The relocation oracle exposes coverage.multiple_hi16 (one LO16 resolving several pending HI16s), but the real-Ghidra lane never required it, and Clang's C output never produces that stream. Ghidra's loader could mishandle it while verify:ghidra:mips-relocatable still passed, although it is common in real objects: 24 of the 30 GCC-built kernel modules I checked contain it.

Change

  • tests/conformance/c/mips-relocatable.c: an assembly block with two %hi and exactly one %lo of a dedicated symbol, so any assembler that orders each HI16 before a matching LO16 emits both HI16s ahead of that single LO16 (Clang 21: HI@0 HI@4 LO@8; GNU as 2.45: HI@4 HI@0 LO@8). The first revision relied on Clang 21's sort; see the review thread.
  • scripts/verify-real-ghidra-mips-relocatable.mjs: requires coverage.multiple_hi16.
  • docs/ghidra-mips.md: lists the requirement.

Verification

Host: Linux x64, Ghidra 12.1.4, OpenJDK 21.0.12, Clang 21, GNU readelf.

  • node scripts/verify-real-ghidra-mips-relocatable.mjs: LE, BE and the soft-float -mlong-calls module variant all passed, each with multiple_hi16, shared_hi16 and lo16_carry true; process lineage verified. On the previous fixture the same lane reported multiple_hi16: false, so the new requirement would have failed.
  • vitest on tests/conformance/ghidra and src/ghidra/GhidraMipsProfile.test.ts: 73 passed. oxfmt --check, oxlint and jscpd pass.

Branched from the #1950 merge commit (290d301ec) because syncing my fork past #1963's workflow change needs a token scope I don't have; none of the three files changed on main since, and the branch merges cleanly.


🔄 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/1974 **Author:** [@AurelioB](https://github.com/AurelioB) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `test/mips-relocatable-multiple-hi16` --- ### 📝 Commits (2) - [`56fdfe6`](https://github.com/morluto/rea/commit/56fdfe6d60696fe32822b94afd833ae3cc00489e) test(ghidra): require pending multi-HI16 coverage in the real MIPS relocatable lane - [`6c58f89`](https://github.com/morluto/rea/commit/6c58f8903837e4b34290bfc9fcced8480c715aff) test(ghidra): make the MIPS multi-HI16 fixture independent of relocation sorting ### 📊 Changes **3 files changed** (+29 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/ghidra-mips.md` (+4 -2) 📝 `scripts/verify-real-ghidra-mips-relocatable.mjs` (+1 -0) 📝 `tests/conformance/c/mips-relocatable.c` (+24 -1) </details> ### 📄 Description Follow-up to #1950, addressing the post-merge Codex review comment on `scripts/verify-real-ghidra-mips-relocatable.mjs`. ## Problem The relocation oracle exposes `coverage.multiple_hi16` (one LO16 resolving several pending HI16s), but the real-Ghidra lane never required it, and Clang's C output never produces that stream. Ghidra's loader could mishandle it while `verify:ghidra:mips-relocatable` still passed, although it is common in real objects: 24 of the 30 GCC-built kernel modules I checked contain it. ## Change - `tests/conformance/c/mips-relocatable.c`: an assembly block with two `%hi` and exactly one `%lo` of a dedicated symbol, so any assembler that orders each HI16 before a matching LO16 emits both HI16s ahead of that single LO16 (Clang 21: `HI@0 HI@4 LO@8`; GNU as 2.45: `HI@4 HI@0 LO@8`). The first revision relied on Clang 21's sort; see the review thread. - `scripts/verify-real-ghidra-mips-relocatable.mjs`: requires `coverage.multiple_hi16`. - `docs/ghidra-mips.md`: lists the requirement. ## Verification Host: Linux x64, Ghidra 12.1.4, OpenJDK 21.0.12, Clang 21, GNU readelf. - `node scripts/verify-real-ghidra-mips-relocatable.mjs`: LE, BE and the soft-float `-mlong-calls` module variant all `passed`, each with `multiple_hi16`, `shared_hi16` and `lo16_carry` true; process lineage verified. On the previous fixture the same lane reported `multiple_hi16: false`, so the new requirement would have failed. - `vitest` on `tests/conformance/ghidra` and `src/ghidra/GhidraMipsProfile.test.ts`: 73 passed. `oxfmt --check`, `oxlint` and `jscpd` pass. Branched from the #1950 merge commit (`290d301ec`) because syncing my fork past #1963's workflow change needs a token scope I don't have; none of the three files changed on `main` since, and the branch merges cleanly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:12 +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#4941
No description provided.