bug-glibc
[Top][All Lists]
Advanced

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

Re: stat() problem in shared libraries (yes /usr/lib/libc.so is correct)


From: Andreas Jaeger
Subject: Re: stat() problem in shared libraries (yes /usr/lib/libc.so is correct)
Date: Thu, 20 Sep 2001 19:31:02 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Academic Rigor)

"Michael F. Brown" <address@hidden> writes:

> Hi,
>
> I've read the glibc FAQ as well as searched this lists archives for
> an answer on this issue.
>
> We ship a shared object which uses stat, and on more recent versions
> of glibc (2.2.2) when running with our library we get the error
> message:
>
> "error while loading shared libraries: /usr/lib/libmy_stat.so:
> undefined symbol: stat"
>
> Yes, /usr/lib/libc.so looks like:
>
> /* GNU ld script
>    Use the shared library, but some functions are only in
>    the static library, so try that secondarily.  */
> GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
>
> This is reproducible on various linux hosts.
>
> Here's a sample program and Makefile:
>
> ---- Makefile ----
>
> all: my_main
>
> my_main: my_main.c /lib/libmy_stat.so
>         gcc -Wall -g -o my_main my_main.c -lmy_stat
>
> /lib/libmy_stat.so: my_stat.o
>         ld -G -dy -o /lib/libmy_stat.so my_stat.o

You should not link on Linux with just ld, use gcc for linking.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs address@hidden
   private address@hidden
    http://www.suse.de/~aj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]