<div class="gmail_quote">2010/3/10 Daniel Baluta <span dir="ltr"><<a href="mailto:daniel.baluta@gmail.com">daniel.baluta@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2010/3/10 Cosmin Ratiu <<a href="mailto:cosminratiu@gmail.com">cosminratiu@gmail.com</a>>:<br>
<div class="im">> Din cate inteleg eu din -l din manual, se pare ca cauta intai .a si apoi<br>
> .so.<br>
<br>
</div>Hmm, mie din pagina de manual nu mi se pare clar care bibliotecă<br>
este căutată prima.<br></blockquote><div><br>Din "The only difference between using an -l option and specifying a file name is that -l surrounds library with lib and .a and searches several directories" si din "The linker searches a standard list of directories for the library, which is actually a file named liblibrary.a. The linker then uses this file as if it had been specified precisely by name" am inteles ca prefera .a-urile default.<br>
<br>Din experienta stiu ca se leaga si so-urile cu acelasi -llibrary. Presupun ca e manual-ul confuz.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Un exemplu simplu, pentru un executabil legat cu -lm arată că<br>
întâi se caută .so<br>
<br>
$ gcc -o test test.c -lm<br>
$ ldd test<br>
linux-gate.so.1 => (0x00f62000)<br>
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00581000)<br>
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00aa0000)<br>
/lib/ld-linux.so.2 (0x00ce5000) </blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
De asemenea ([1]) spune că default se încarcă bibliotecile partajate.<br>
<br>
thanks,<br>
Daniel.<br>
<br>
[1] <a href="http://www.network-theory.co.uk/docs/gccintro/gccintro_25.html" target="_blank">http://www.network-theory.co.uk/docs/gccintro/gccintro_25.html</a><br>
<div><div></div><br></div></blockquote></div><br>Da, aici scrie negru pe alt ce se intampla de fapt :).<br>Well, you learn something new every day.<br><br>Cosmin.<br>