[llvm-bugs] [Bug 35544] New: Wasm: add new weak global symbol "__stack_top"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 6 04:32:35 PST 2017


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: unassignedbugs at nondot.org
          Reporter: ncw at realvnc.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171206/d81cf8df/attachment.html>


More information about the llvm-bugs mailing list