wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

How to use the object format file which output by wamrc ?

Open hangedfish opened this issue 3 years ago • 1 comments

I create a ELF object file with wamrc,but i understand how to use it.

.\wamrc.exe --format=object --target-abi=eabi --target=aarch64 -o script.o .\script.wasm

It could not loaded by iwasm. May be link with iwasm?

// core/iwasm/common/wasm_runtime_common.c
PackageType
get_package_type(const uint8 *buf, uint32 size)
{
    if (buf && size >= 4) {
        if (buf[0] == '\0' && buf[1] == 'a' && buf[2] == 's' && buf[3] == 'm')
            return Wasm_Module_Bytecode;
        if (buf[0] == '\0' && buf[1] == 'a' && buf[2] == 'o' && buf[3] == 't')
            return Wasm_Module_AoT;
    }
    return Package_Type_Unknown;
}

hangedfish avatar Aug 11 '22 08:08 hangedfish

I am afraid that --format=object is just for debugging and iwasm only accept .wasm and .aot.

lum1n0us avatar Aug 12 '22 01:08 lum1n0us