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: shared lib problem on PPC (was: Re: glibc 2.1.92 tst-getdate failure on linuxppc)


On Sat, 26 Aug 2000, Ulrich Drepper wrote:
> Works just fine for me on x86.
>
> >    testdat = dlsym(sohandle, "testdat");
> >    if (testdat->next == -1) abort();
>
> If this test fails it means that the module didn't actually get
> unloaded.  Please note that there is no requirement in the specs that
> this actually happens, programs relying on this are broken.  Anyhow,
> glibc tries to unload a module completely.  What does LD_DEBUG=files
> produce?  Should be something like this:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 28440:
> 28440:  file=libdl.so.2;  needed by ./testshareddata
> 28440:  file=libdl.so.2;  generating link map
> 28440:    dynamic: 0x4001bea8  base: 0x40019000   size: 0x00002f8c
> 28440:      entry: 0x4001abf0  phdr: 0x40019034  phnum:          5
> 28440:
> 28440:
> 28440:  file=libc.so.6;  needed by ./testshareddata
> 28440:  file=libc.so.6;  generating link map
> 28440:    dynamic: 0x4013e9b4  base: 0x4001c000   size: 0x001269c8
> 28440:      entry: 0x40037900  phdr: 0x4001c034  phnum:          5
> 28440:
> 28440:
> 28440:  calling init: /lib/libc.so.6
> 28440:
> 28440:
> 28440:  calling init: /lib/libdl.so.2
> 28440:
> 28440:
> 28440:  initialize program: ./testshareddata
> 28440:
> 28440:
> 28440:  transferring control: ./testshareddata
> 28440:
> 28440:  file=./shareddata.so;  generating link map
> 28440:    dynamic: 0x4014488c  base: 0x40143000   size: 0x00001940
> 28440:      entry: 0x40143680  phdr: 0x40143034  phnum:          3
> 28440:
> 28440:
> 28440:  calling init: ./shareddata.so
> 28440:
> 28440:
> 28440:  calling fini: ./shareddata.so
> 28440:
> 28440:  file=./shareddata.so;  generating link map
> 28440:    dynamic: 0x4014488c  base: 0x40143000   size: 0x00001940
> 28440:      entry: 0x40143680  phdr: 0x40143034  phnum:          3
> 28440:
> 28440:
> 28440:  calling init: ./shareddata.so
> 28440:
> 28440:
> 28440:  calling fini: ./shareddata.so
> 28440:
> 28440:
> 28440:  calling fini: /lib/libdl.so.2
> 28440:
> 28440:
> 28440:  calling fini: /lib/libc.so.6
> 28440:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> You can see that the module is unloaded and reloaded.

Hmm, not on PPC:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11743:
11743:  file=libdl.so.2;  needed by ./testshareddata
11743:  file=libdl.so.2;  generating link map
11743:    dynamic: 0x0ffef008  base: 0x0ffdd000   size: 0x0001226c
11743:      entry: 0x0ffded00  phdr: 0x0ffdd034  phnum:          5
11743:
11743:
11743:  file=libc.so.6;  needed by ./testshareddata
11743:  file=libc.so.6;  generating link map
11743:    dynamic: 0x0ffc7268  base: 0x0fea0000   size: 0x0012ca34
11743:      entry: 0x0fec8418  phdr: 0x0fea0034  phnum:          5
11743:
11743:
11743:  calling init: /lib/libc.so.6
11743:
11743:
11743:  calling init: /lib/libdl.so.2
11743:
11743:
11743:  initialize libc
11743:
11743:
11743:  initialize program: ./testshareddata
11743:
11743:
11743:  transferring control: ./testshareddata
11743:
11743:  file=./shareddata.so;  generating link map
11743:    dynamic: 0x0fe8f828  base: 0x0fe7f000   size: 0x00010948
11743:      entry: 0x0fe7f600  phdr: 0x0fe7f034  phnum:          3
11743:
11743:
11743:  calling init: ./shareddata.so
11743:
11743:
11743:  file=./shareddata.so;  needed by /lib/libdl.so.2 (relocation 
dependency)
11743:
Aborted (core dumped)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So the fini code is never called it seems. Which code should I check for 
changes compared to glibc-2.1.3 (where the same binary worked)?

Franz.

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