Skip to content

"invalid relocation offset" when trying to execute AOT binary on ESP32-S3 #4025

Open
@SneezingCactus

Description

@SneezingCactus

Hello, I've been using WAMR for my project and I recently decided to give AOT compilation a go. However, I can't seem to get any AOT binary to load and execute properly. It would always throw this error on wasm_runtime_load:

AOT module load failed: invalid relocation offset.

I also tried compiling with the wamrc --xip option enabled as I figured this would make it so that the instructions are executed directly from PSRAM without having to copy into IRAM (which is something I'd want anyways), however by doing this I'm met with a different wasm_runtime_load error:

AOT module load failed: cannot apply relocation to text section for aot file generated with "--enable-indirect-mode" flag

Looking into WAMR's source code and doing some extra logging, I found out that the binary's .rela.literal section was being determined to have a size of 0, causing check_reloc_offset to throw the invalid relocation offset error when relocating this section. This goes way out of my lane of knowledge however, so I don't think I can comment on this further.

I am using the 2.2.0 release of WAMR (though I also tried main branch with same results), AOT binaries are being compiled on Ubuntu 22.04 with LLVM 17.0.1 (Espressif fork), and the WASM host is an ESP32-S3 running on ESP-IDF v5.4.

Is there something I'm missing here? Any help would be very much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions