Add a big-endian SuperH fixture for the p-code converter tests - #225
Add a big-endian SuperH fixture for the p-code converter tests#225zardus wants to merge 1 commit into
Conversation
The Sega 32X hello-world skeleton from marsdev, built from examples/32x-skeleton at 3318d3f39823154b24ce48bfa5d8fe6e3f6cde3f. It is MIT-licensed; tests/sh4/LICENSE.md carries the license text and the provenance. angr's p-code AIL converter reads part of a wide unique varnode, and which half of the value the varnode's own address holds depends on the byte order. No big-endian object here can show that: over about 1.69M instructions of ppc, ppc64, mips, mips64 and m68k code, SLEIGH never reads a unique at the parent's own address with a smaller size. SuperH's mac.l and dmulu.l both do, and 90 blocks of this object reach it.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveats: this repository has no test suite, so the fixture's evidence is the shape scan and the consumer load rather than a suite result. |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS The whole AIL block converted from Before — angr master reads MACL from a tmp no statement defines, and gives MACH the product's low half unshifted. Two stacked changes separate the two blocks: angr/angr#6934 repairs the first line, the change on top of it repairs the second. angr master 87411a719c96ddc3f3954590b1833b1789e19697After — MACL is the low half and MACH is the high half: with the angr change applied |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
angr's p-code AIL converter reads part of a wide
uniquevarnode, and which endof the wide value that sub-range names depends on the byte order. Nothing here
can assert that. Scanning every ELF under
tests/at this branch's merge basefor a big-endian file whose
e_machineisEM_SH:The one SuperH object here,
tests/sh4/test-instr_sh4, is little-endian.Root cause
SuperH is the only architecture in reach whose SLEIGH model reads a unique at the
parent's own address with a smaller size:
mac.landdmulu.lboth do. Six ofthe big-endian objects here --
ppc/libc.so.6,ppc64/libc.so.6,mips/libc.so.6,mips/busybox,mips64/libc.so.6andm68k/mul_add_sub_xor_m68k_be, 1,690,970 instructions between them -- produce nosuch read at all.
Fix
tests/sh4/hello_32x_sh2beis the Sega 32X hello-world skeleton frommarsdev, built from
examples/32x-skeletonat
3318d3f.It is MIT-licensed, and
tests/sh4/LICENSE.mdcarries the license text and theprovenance beside it. angr loads it through pypcode as
SuperH4:BE:32:default;90 of its 313 blocks reach the converter path.
Testing
This repository has no suite of its own. The fixture is exercised by the angr
change that needs it, whose
tests/ailment/test_converter_pcode.pyfails againstangr master on this file and passes with that change applied; the before and
after are in the comment below.
Validation: #225 (comment)
session: sharpen