https://bugs.llvm.org/show_bug.cgi?id=35544

            Bug ID: 35544
           Summary: Wasm: add new weak global symbol "__stack_top"
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedb...@nondot.org
          Reporter: n...@realvnc.com
                CC: llvm-bugs@lists.llvm.org

Could we add a new symbol to those provided by LLD? It should be a weak global
integer called "__stack_top" and point to the end of the stack region, as
calculated in Writer::layoutMemory.

This would be useful in Musl. Currently, when malloc needs to provide fresh
pages of memory to the Wasm module, all it knows initially is the size of the
allocated region from "__builtin_wasm_current_memory". However, the Wasm page
size is large (64KiB) so potentially 64KiB of memory at the end of the current
page is unused.

It would nice if malloc could start allocating its data right from the top of
the stack, instead of wasting space by beginning from the next Wasm page.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to