This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: NEW PATCH: Handle undefined symbol in DSO from DT_NEEDED


On Wed, May 09, 2001 at 03:53:21PM -0700, H . J . Lu wrote:
> > 
> > Are you sure it does not work or is it just a guess?
> > I've just compiled a program using atexit on a glibc 2.0.7 system (RHL 5.2),
> > plus a program using shared library which uses atexit on the same box, moved
> > them to glibc 2.2.3 box (both the program and DSO have unversioned atexit
> > reference, glibc has atexit@GLIBC_2.0 only) and they work very well.
> > Anyway, if you show me a testcase which would not work, then I should put
> 
> I have a testcase. I will post it later.
> 

I am enclosing a testcase here.

# make
cc    -c -o foo.o foo.c
cc -fPIC -c b.c
cc -fPIC -c a.c
cc -fPIC -c c.c
cc -shared -o lib-c.so c.o
cc -shared -o lib-a.so a.o lib-c.so
cc -shared -o lib-b.so b.o lib-a.so
cc -o foo foo.o -Wl,-rpath,. lib-b.so
cc -fPIC -c c1.c
cc -Wl,-soname,lib-c.so -Wl,--version-script=c.map -shared -o lib-c1.so c1.o
cc -fPIC -c c2.c
cc -Wl,-soname,lib-c.so -Wl,--version-script=c.map -shared -o lib-c2.so c2.o
./foo
bar
cp lib-c1.so lib-c.so
cc -o default foo.o -Wl,-rpath,. lib-b.so
./lib-a.so: undefined reference to `bar'
collect2: ld returned 1 exit status

./lib-a.so is never mentioned in the command line.

H.J.

needed.tar.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]