baremetal: place mmap memory region in .text segment

This commit is contained in:
2026-04-16 22:56:24 +02:00
parent fd69a4e76e
commit 1521011029

View File

@ -44,8 +44,9 @@ os_dumps_proc_mem_info(char *out, unsigned int size)
// #11 0x08048cff in wasm_runtime_load // #11 0x08048cff in wasm_runtime_load
// #12 0x08048112 in main // #12 0x08048112 in main
// I hope this isn't too simple // Place mmap memory inside the .text segment, so FAIL* ignores it
static uint8_t mmap_space[MMAP_SPACE_SIZE]; __attribute__((section(".text.wamr_aot"),
aligned(4096))) static uint8_t mmap_space[MMAP_SPACE_SIZE];
static size_t mmap_offset = 0; // Free space begins here static size_t mmap_offset = 0; // Free space begins here
static size_t static size_t
@ -58,6 +59,7 @@ align_up(size_t x, size_t a)
return (x + a - 1) & ~(a - 1); return (x + a - 1) & ~(a - 1);
} }
// I hope this isn't too simple
void * void *
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file) os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
{ {