>Weird, .a files are static libraries, not dynamic libraries. I didn't<br>
>think dlopen could do anything useful with them. Huh.<br><br>sorry! typo! I meant libm.so :)<br><br>Thanks for the other pointers, I'll read them'<br><br>-Earlence<br><br><div class="gmail_quote">On Mon, Jul 18, 2011 at 5:02 AM, Rob Landley <span dir="ltr"><<a href="mailto:rob@landley.net">rob@landley.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 07/16/2011 02:05 PM, Earlence Fernandes wrote:<br>
>>Have you tried to dlopen() one of the other shared libraries that comes<br>
>>with uClibc just to make sure that the issue is dlopen() and not it<br>
>>being really confused by that particular library?<br>
><br>
> I tried it with libm.a shipped with my native compiler. It worked ok!!<br>
><br>
> strange that is doesn't open /system/lib/libc.so<br>
> Thoughts?<br>
><br>
> -Earlence<br>
<br>
</div>Weird, .a files are static libraries, not dynamic libraries. I didn't<br>
think dlopen could do anything useful with them. Huh.<br>
<br>
Shared libraries have all sorts of funky hooks and things, initializion<br>
code, different types of relocations (REL vs RELA, lazy binding needs<br>
its own extra set of tables, and of course the gnu guys extended elf<br>
with their own hash stuff as blogged about<br>
<a href="http://blogs.oracle.com/ali/entry/gnu_hash_elf_sections" target="_blank">http://blogs.oracle.com/ali/entry/gnu_hash_elf_sections</a> ...<br>
<br>
There's a marvelous set of blog entries on writing a linker by the guy<br>
who did GOLD, it's linked to as reference #1 from the gold wikipedia entry:<br>
<br>
<a href="http://en.wikipedia.org/wiki/Gold_%28linker%29" target="_blank">http://en.wikipedia.org/wiki/Gold_(linker)</a><br>
<br>
Denys Vlasenko did a marvelous talk on some linker subtleties he<br>
encountered, the video of which is one of these:<br>
<br>
<a href="http://free-electrons.com/blog/elc-2010-videos/" target="_blank">http://free-electrons.com/blog/elc-2010-videos/</a><br>
<br>
If you want to learn about how linkers work, the standard reference is:<br>
<br>
<a href="http://www.iecc.com/linker/" target="_blank">http://www.iecc.com/linker/</a><br>
<br>
Plus the ELF spec:<br>
<br>
<a href="http://refspecs.freestandards.org/elf/" target="_blank">http://refspecs.freestandards.org/elf/</a><br>
<br>
So it's entirely possible something is subtly wrong with that .so<br>
because they wrote their own dynamic linker that doesn't use all the<br>
fields the others do, and thus uClibc's following an unexpected null<br>
pointer or something. But that's just a guess.<br>
<font color="#888888"><br>
Rob<br>
</font></blockquote></div><br>