<div dir="ltr">

<span style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi Sam,</span><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">Thanks for your answer!</div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">Sorry I didn't really know how to process, but this issue block me to make some legacy C code works without having some glue with a bit static lib ;(</div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">(The change have really low risk)<br><div>The changes I used locally to make dlopen/dlclose et dlsym mechanism works :) :</div><div><div>Index: wasm/Writer.cpp</div><div>==============================<wbr>==============================<wbr>=======</div><div>--- wasm/Writer.cpp     (revision 330555)</div><div>+++ wasm/Writer.cpp     (working copy)</div><div>@@ -257,7 +257,7 @@</div><div>   raw_ostream &OS = Section->getStream();</div><div><br></div><div>   writeUleb128(OS, 1, "table count");</div><div>-  WasmLimits Limits = {WASM_LIMITS_FLAG_HAS_MAX, TableSize, TableSize};</div><div>+  WasmLimits Limits = {0, TableSize, TableSize};</div><div>   writeTableType(OS, WasmTable{WASM_TYPE_ANYFUNC, Limits});</div><div> }</div></div><div><br></div><div>May be to have a code more readable  <span> </span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">WASM_LIMITS_FLAG_HAS_NO_MAX (=0) can be added.</span></div><div><br></div><div>Thks,</div><div>Ghis</div></div>

<br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-03 23:45 GMT+02:00 Sam Clegg <span dir="ltr"><<a href="mailto:sbc@google.com" target="_blank">sbc@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ghis<br>
<br>
Originally when we wrote the wasm port of lld we didn't support<br>
importing or exporting the table so it made sense to set a max size.<br>
However, now that we have the --import-table flag I don't see why we<br>
shouldn't support tables without a max size.  Feel free to send a<br>
patch, or open a bug and I will get around to it.<br>
<br>
cheers,<br>
sam<br>
<div><div class="h5"><br>
On Fri, Jun 1, 2018 at 6:00 AM, HUDE Ghislain via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Hello,<br>
><br>
> The table generated by lld (Wasm target) have a max size.<br>
><br>
> So this make impossible to add some others functions in the table .<br>
><br>
> As for the moment only one Table is available in WAsm this is the only way<br>
> to add function in a dynamic way.<br>
><br>
><br>
><br>
> Having a none static size of the table is useful for a kind dynamic<br>
> loader/inker at run-time: by adding some exported functions coming from<br>
> another modules in the table, so call_indirect can call dynamically some<br>
> function coming from another wasm module.<br>
><br>
><br>
><br>
> So I am wondering if the static size of the table have a specific goal ?<br>
><br>
> If not did you think the WASM_LIMITS_FLAG_HAS_MAX can be remove ?<br>
><br>
><br>
><br>
> <a href="https://llvm.org/svn/llvm-project/lld/trunk/wasm/Writer.cpp" rel="noreferrer" target="_blank">https://llvm.org/svn/llvm-<wbr>project/lld/trunk/wasm/Writer.<wbr>cpp</a><br>
><br>
>  void Writer::createTableSection() {<br>
><br>
> ..<br>
><br>
> WasmLimits Limits = {WASM_LIMITS_FLAG_HAS_MAX, TableSize, TableSize};<br>
><br>
><br>
><br>
><br>
><br>
> Thks in advance,<br>
><br>
> Ghis<br>
><br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
</blockquote></div><br></div>