<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Wasm: add new weak global symbol "__stack_top""
   href="https://bugs.llvm.org/show_bug.cgi?id=35544">35544</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wasm: add new weak global symbol "__stack_top"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ncw@realvnc.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>