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: A patch for the unversioned lookup


On Thu, May 03, 2001 at 08:27:46PM -0700, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
> 
> > While working on the atexit related problem, I noticed 2 problems
> > with the unversioned lookup:
> 
> I will not even look at this unless you provide examples.
> 

I enclosed a testcase in

http://sources.redhat.com/ml/libc-alpha/2001-05/msg00021.html

The current glibc does

# make
cc    -c -o foo.o foo.c
cc -fPIC -c b.c
cc -shared -o lib-b.so b.o
cc -fPIC -c c0.c
cc -Wl,-soname,lib-c.so -shared -o lib-c0.so c0.o
cp lib-c0.so lib-c.so
cc -o foo -Wl,-rpath,. foo.o lib-b.so lib-c.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
./foo
bar
cp lib-c2.so lib-c.so
./foo
bar

The last one should fail since

# objdump --dynamic-sym lib-c.so | grep bar
000000000000086c g    DF .text  000000000000002a  Base        _old_bar_1
0000000000000840 g    DF .text  000000000000002a  Base        _old_bar
000000000000086c g    DF .text  000000000000002a (VERS.1)     bar
0000000000000840 g    DF .text  000000000000002a (VERS.0)     bar

There are 2 versions of bar, but none of them is default. With my
patch, I got

# /export/build/gnu/glibc/elf/ld-linux.so.2 ./foo
./foo: error while loading shared libraries: ./lib-b.so: undefined symbol: bar

Let me know if you have trouble getting my testcase.

Thanks.



H.J.


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