about shared libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I've setup a project using autoconf/automake/libtool
in which I create in the same row a static/shared
library and a binary written in assembly and not
linked to c, plus a test-case I also wrote in c.

However the test-case (for which I wrote a header file
complying with my library definitions) segfaults as
soon as I attempt to link with it, even if I'm not
using any of the functions it provides.

This is something which doesn't happen if I link
against the static version, though I'm not experienced
enough so as to know why.

Actually I've noticed a subtle difference in the
shared version:

00001cc8 a _DYNAMIC
00001db4 a _GLOBAL_OFFSET_TABLE_

Those symbols appears as external in anyother shared
library on my system, though I haven't found a way of
make it change unless I'm supossed to create my own
link script for this library (neither I'd know).

These are outputs I've pasted for if anyone could give
me a hint:

the c-test case (segfaults on _IO_vfprintf_internal)
as soon as I try to link with my library:

http://pastebin.ca/731746


nm's output of such a library:

http://pastebin.ca/731775


and the output from make when building it:

http://pastebin.ca/731776


What I did was to define BUILDING_LIBRARY when doing
so, and then _init_lib gets declared instead of _start
, and vicercersa when not, right at the end the
test-case gets built.

Regards,




      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Linux C Programming]     [Linux for Hams]     [DCCP]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux