<p dir="ltr">That's what the shim does. You need to export the main symbol to call it with dlopen.</p>
<div class="gmail_quote">On Jul 2, 2015 08:51, "Tamas Berghammer" <<a href="mailto:tberghammer@google.com">tberghammer@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">tberghammer added a comment.<br>
<br>
In <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10887-23198532&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=9o79wx8rOdSFZEVmPRY821HJNe_oHIiSYBJ9_2CnqTI&s=hbzxyqLtNN7T_9ndKYs5Q26qqPR3MprHp1RGNl5t6MI&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10887#198532</a>, @labath wrote:<br>
<br>
> In <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10887-23198526&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=9o79wx8rOdSFZEVmPRY821HJNe_oHIiSYBJ9_2CnqTI&s=6vxRG6N3HJItk6bh7_lxgzcHcLGgYhN-xeV4jB0WCCI&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10887#198526</a>, @chaoren wrote:<br>
><br>
> > Using a shim results in about a 5M increase in the lldb-server binary<br>
> > because of the need to export all symbols dynamically. And still has those<br>
> > two bugs (which would be in the system libs, if linked dynamically).<br>
><br>
><br>
> Couldn't this be avoided somehow (with some __attribute__ magic or something). In reality, we just need one symbol, "lldb_main", or such).<br>
><br>
> And if that proves unfeasible and we have to statically link, I would prefer patching bugs in older libc over patching "features" in newer ones.<br>
<br>
<br>
I think we can avoid the size increase if we compile lldb-server as we do it now and on older target launch it with calling main through dlopen.<br>
<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10887&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=9o79wx8rOdSFZEVmPRY821HJNe_oHIiSYBJ9_2CnqTI&s=-Z80etnQzsVKEnHAERHfxS22ssxg91ididcpN8e-eu0&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10887</a><br>
<br>
<br>
<br>
</blockquote></div>