This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Shared library question

On Thu, Jul 18, 2002 at 08:09:02PM +0400, Zagorodnev, Grigory wrote:
> >> Actually I found the reason and made the fix for _my_particular_case. But
> it
> >> seems to be a linker bug. Should it be reflected in separate report or
> not?
> >
> >Please provide a small testcase to show the bug. I will look into it.
> Given test case reproduces the _desired_ situation: 'old' application is
> still running, new - could not be built. You should see final 'PASSED'
> message.
> Now, if you uncomment marked line in the file and run the test
> again, you will see the failure: 'old' application is unable to run. 
> And, of cource you will not see 'PASSED' message.
> Note: just run make.

Your Makefile is wrong.


is not the same as


After fixing that, I got

# make
- Build the 'old' library first
gcc -shared -Wl, -o libfoo.c 
- Next, build the application linked against it
gcc main.c -L. -lfoo
- Make sure that it runs (you should see 'foo is there' message)
foo is there
- Now build the 'new' library
gcc -shared -DLIB_X -Wl, -o libfoo.c
- Make sure that the application is still runable
foo is there
- Now try build application linked against 'new' library 
  (you should see unresolved reference message)
gcc main.c -L. -lfoo 2>/dev/null
make: [all] Error 1 (ignored)

BTW, there was a bug in glibc, which would cause your problem. It was
fixed by

2002-04-02  Ulrich Drepper  <>

       * elf/do-lookup.h (do_lookup): 2 is the first user-defined version
        number [PR libc/3111].

Please make sure your glibc is ok.


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