So for example this: <https://gist.github.com/playXE/bcadfaefeecaf511d81f4b141ca1e1bc>. There is relatively large Cranelift IR dump but when I look at disassembly it seems that it just splits function into a few and other parts I can't see
Cranelift can't split functions into multiple parts. I think whatever you used for disassembling returned an incomplete disassembly. It likely chokes on the constant embedded inside the instruction stream. At address 0x1478140d0 there should be a 64 bit constant followed by the rest of the code. The branch instruction at the end of the disassembly jumps over this constant.
@Adel Prokurov ^
bjorn3 said:
Cranelift can't split functions into multiple parts. I think whatever you used for disassembling returned an incomplete disassembly. It likely chokes on the constant embedded inside the instruction stream. At address 0x1478140d0 there should be a 64 bit constant followed by the rest of the code. The branch instruction at the end of the disassembly jumps over this constant.
Thanks for the reply. I'll look into alternative disassembler then (I am using capstone at the moment)
So I tried to use bad64 to disarm arm64 code and it works just fine. Probably capstone just does not work correctly for M1?
Adel Prokurov has marked this topic as resolved.
For capstone you will have to explicitly enable the skipdata option. Cranelift uses also capstone for debugging: https://github.com/bytecodealliance/wasmtime/blob/05ace6c0e24f4fd8e256edab7de841a5b28c5735/cranelift/src/disasm.rs#L96
bjorn3 said:
For capstone you will have to explicitly enable the skipdata option. Cranelift uses also capstone for debugging: https://github.com/bytecodealliance/wasmtime/blob/05ace6c0e24f4fd8e256edab7de841a5b28c5735/cranelift/src/disasm.rs#L96
I didn't know that! Thanks for help
Last updated: Dec 23 2024 at 13:07 UTC