fix(verification): integrate Linux Hopper lane with current contracts
Integrate mainae8051302while retaining the Linux setup, orphan detection, launcher restoration and explicit string-recognition coverage corrections. Move verification guidance to its current owner and use the test-scoped temporary-directory helper. The checkout matches all 3,175 exported source-file digests of the tested candidate. Git stores the Windows captureGhidraLaunch.cmd fixture with LF; its exported checkout uses CRLF per .gitattributes. It is outside Linux Hopper execution. No native run is attributed to different runtime bytes. Real Hopper conformance: 9e7de373-4686-4820-ae48-801e536589b7. Uninterrupted Linux setup: 93584b53-944b-47cf-a6a4-b0d4ff8a4961. The exact97b76aa2run remains separate: ae4de7ff-dd2a-4c73-88dc-6dbf1ad7c537. 21 focused tests, check, docs:check, four fixtures, discovery, package verification and pack dry-run passed. Linux native decoded omissions, macOS/other builds and installed npm artifacts with Hopper remain unverified. Refs #339, #340
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
/* Relocatable (ET_REL) static-analysis fixture, built with -c -G0 and never
|
||||
* executed or linked by REA. It exercises the relocations Linux MIPS kernel
|
||||
* modules use: R_MIPS_26 calls, HI16/LO16 address pairs (one HI16 shared by
|
||||
* several LO16s, two HI16s resolved by one LO16, and a LO16 >= 0x8000 that
|
||||
* forces a HI16 carry), R_MIPS_32
|
||||
* data words, and undefined external code and data symbols. powf is an
|
||||
* external whose float prototype Ghidra's C library archive supplies by name,
|
||||
* so soft-float builds must give it the soft-float prototype too.
|
||||
*/
|
||||
extern int rea_mips_rel_external(int value);
|
||||
extern int rea_mips_rel_external_data;
|
||||
extern float powf(float base, float exponent);
|
||||
|
||||
struct rea_mips_rel_pair {
|
||||
int first;
|
||||
int second;
|
||||
};
|
||||
|
||||
struct rea_mips_rel_pair rea_mips_rel_pair = { 0x1111, 0x2222 };
|
||||
/* Places rea_mips_rel_carry past a signed 16-bit low-half boundary. */
|
||||
char rea_mips_rel_padding[0x8000] = { 1 };
|
||||
int rea_mips_rel_carry = 0x3333;
|
||||
/* Referenced only by rea_mips_rel_highs, so its single LO16 stays unique. */
|
||||
int rea_mips_rel_highs_target = 0x4444;
|
||||
static const char rea_mips_rel_marker[] = "rea-mips-relocatable-fixture";
|
||||
|
||||
__attribute__((noinline)) int rea_mips_rel_leaf(int value)
|
||||
{
|
||||
return value * 3 + rea_mips_rel_pair.first + rea_mips_rel_pair.second;
|
||||
}
|
||||
|
||||
__attribute__((noinline, long_call)) int rea_mips_rel_far(int value);
|
||||
|
||||
int rea_mips_rel_far(int value)
|
||||
{
|
||||
return value + rea_mips_rel_marker[value & 7] + rea_mips_rel_carry;
|
||||
}
|
||||
|
||||
int (*const rea_mips_rel_table[])(int) = {
|
||||
rea_mips_rel_leaf,
|
||||
rea_mips_rel_far,
|
||||
rea_mips_rel_external,
|
||||
};
|
||||
|
||||
__attribute__((noinline)) int rea_mips_rel_scaled(int value)
|
||||
{
|
||||
float scaled = powf(1.5f, 2.5f);
|
||||
return value ^ *(int *)&scaled;
|
||||
}
|
||||
|
||||
/* Most GCC-built kernel modules checked contain LO16s that resolve several
|
||||
* pending HI16s; Clang does not produce that from C. Two %hi and exactly one
|
||||
* %lo of a symbol nothing else references: any assembler that orders each
|
||||
* HI16 before a matching LO16 (GNU as, every LLVM version) must emit both
|
||||
* HI16s ahead of that single LO16, which therefore resolves both.
|
||||
*/
|
||||
__asm__(".text\n"
|
||||
".globl rea_mips_rel_highs\n"
|
||||
".type rea_mips_rel_highs, @function\n"
|
||||
".set push\n"
|
||||
".set noreorder\n"
|
||||
"rea_mips_rel_highs:\n"
|
||||
" lui $2, %hi(rea_mips_rel_highs_target)\n"
|
||||
" lui $3, %hi(rea_mips_rel_highs_target)\n"
|
||||
" addiu $2, $2, %lo(rea_mips_rel_highs_target)\n"
|
||||
" jr $31\n"
|
||||
" move $3, $2\n"
|
||||
".set pop\n"
|
||||
".size rea_mips_rel_highs, .-rea_mips_rel_highs\n");
|
||||
|
||||
int rea_mips_rel_entry(int value)
|
||||
{
|
||||
return rea_mips_rel_leaf(value) + rea_mips_rel_far(value) +
|
||||
rea_mips_rel_external(value) + rea_mips_rel_external_data +
|
||||
rea_mips_rel_table[value & 1](value) + rea_mips_rel_scaled(value);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/* Soft-float o32 storage fixture; linked with mips.c, never executed by REA.
|
||||
* Without an FPU, float/double values travel in integer registers and stack
|
||||
* slots: pick uses $a0/$a1/$a2 and returns in $v0, wide uses the $a0:$a1 pair,
|
||||
* and mixed aligns d to $a2:$a3 so f and e spill to the stack at 16 and 24.
|
||||
* structured returns through a hidden $a0 pointer, moving scale to $a1. The
|
||||
* typed function pointer makes the caller's indirect call use a prototype that
|
||||
* belongs to no function. No arithmetic, so no compiler-rt helpers are needed.
|
||||
*/
|
||||
volatile unsigned int rea_mips_soft_sink;
|
||||
|
||||
__attribute__((noinline)) float rea_mips_soft_pick(float a, float b, int sel)
|
||||
{
|
||||
return sel ? a : b;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) double rea_mips_soft_wide(double a, int sel)
|
||||
{
|
||||
return sel ? a : 0.5;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) double rea_mips_soft_mixed(int i, double d, float f, double e)
|
||||
{
|
||||
rea_mips_soft_sink = *(volatile unsigned int *)&f;
|
||||
return i ? d : e;
|
||||
}
|
||||
|
||||
struct rea_mips_soft_pair {
|
||||
double first;
|
||||
double second;
|
||||
};
|
||||
|
||||
__attribute__((noinline)) struct rea_mips_soft_pair rea_mips_soft_struct(float scale, int sel)
|
||||
{
|
||||
struct rea_mips_soft_pair pair = { 0.25, 0.75 };
|
||||
rea_mips_soft_sink = *(volatile unsigned int *)&scale;
|
||||
if (sel)
|
||||
pair.first = 1.25;
|
||||
return pair;
|
||||
}
|
||||
|
||||
/* Volatile so the indirect call through this typed pointer is not folded. */
|
||||
float (*volatile rea_mips_soft_callback)(float, float, int) = rea_mips_soft_pick;
|
||||
|
||||
__attribute__((noinline)) unsigned int rea_mips_soft_caller(int sel)
|
||||
{
|
||||
float picked = rea_mips_soft_pick(1.5f, 2.5f, sel);
|
||||
double wide = rea_mips_soft_wide(3.25, sel);
|
||||
double mixed = rea_mips_soft_mixed(sel, 4.75, 5.5f, 6.125);
|
||||
struct rea_mips_soft_pair pair = rea_mips_soft_struct(7.5f, sel);
|
||||
float called = rea_mips_soft_callback(8.5f, 9.5f, sel);
|
||||
return *(unsigned int *)&picked ^ *(unsigned int *)&wide ^ *(unsigned int *)&mixed ^
|
||||
*(unsigned int *)&pair.first ^ *(unsigned int *)&called;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/* Source-owned freestanding analysis fixture. Never execute this target. */
|
||||
volatile unsigned int rea_riscv_global = 7;
|
||||
extern unsigned int rea_riscv_probe(unsigned int value);
|
||||
|
||||
__attribute__((noinline)) unsigned int rea_riscv_leaf(unsigned int value)
|
||||
{
|
||||
return value * 3u + rea_riscv_global;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) double rea_riscv_float(double left, double right)
|
||||
{
|
||||
return left + right;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) unsigned int rea_riscv_entry(unsigned int selector)
|
||||
{
|
||||
return rea_riscv_probe(rea_riscv_leaf(selector + 1u));
|
||||
}
|
||||
Reference in New Issue
Block a user