Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

What should the memory layout look like for wasm modules? #81

@alexcrichton

Description

@alexcrichton

Currently wasm's linker, LLD, largely decides the memory layout for wasm modules and how items interact in the module's memory address space. We should either (a) decide that LLD's layout is ok or (b) figure out a different layout for ourselves and work with that!

Currently with LLD it looks like:

  • Data by default starts at address 1024
  • The stack starts one page (64k) above the end of data and grows down

That's quite a small stack! It looks like LLD has options to change the start of data --global-base but I don't see an option to change the stack. That probably needs to change! - turns out -z stack-size=1024

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions