<div><div dir="auto">Hello all</div></div><div dir="auto">Is someone can help please to make progress on that please and deliver a fix ?</div><div dir="auto">With a static table this is impossible to make dlopen dlclose dlsym works, because the module which call dlopen need to add in this table the symbols from the loaded module, as the size is static normal exception is throw .</div><div dir="auto"><br></div><div dir="auto">Regards </div><div dir="auto">Ghis </div><div><br><div class="gmail_quote"><div>Le ven. 15 juin 2018 à 22:40, HUDE Ghislain <<a href="mailto:hude.ghislain@gmail.com">hude.ghislain@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>

<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><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><div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><div><div>Index: wasm/Writer.cpp</div><div>===================================================================</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></div><div class="gmail_extra"><div class="gmail_quote">2018-06-03 23:45 GMT+02:00 Sam Clegg <span><<a href="mailto:sbc@google.com" target="_blank">sbc@google.com</a>></span>:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><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="m_4770270271233257906h5"><br>
On Fri, Jun 1, 2018 at 6:00 AM, HUDE Ghislain via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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-project/lld/trunk/wasm/Writer.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>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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/mailman/listinfo/llvm-dev</a><br>
><br>
</blockquote></div></div></blockquote></div></div>