shared lib problem on PPC (was: Re: glibc 2.1.92 tst-getdate failure on linuxppc)

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Sat Aug 26 08:59:00 GMT 2000


On Sun, 20 Aug 2000, Ulrich Drepper wrote:
> Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> > Uhm, so _all_ of these fail on other platforms too? I'm asking cause
> > apache no longer starts up on glibc-cvs with this in the logs:
>
> With which version of glibc, which date?

Current development CVS as of yesterday. It fails because this testcase fails:

testshareddata.c:
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
#include <error.h>
#include <mcheck.h>
#include <stdio.h>
#include <stdlib.h>
 
typedef struct { void *next; } strct;
 
int main ()
{
   void *sohandle;
   strct *testdat;
   int ret;
 
   sohandle = dlopen("./shareddata.so", RTLD_NOW | RTLD_GLOBAL);
 
   testdat = dlsym(sohandle, "testdat");
   testdat->next = -1;
 
   ret = dlclose(sohandle);
 
   sohandle = dlopen("./shareddata.so", RTLD_NOW | RTLD_GLOBAL);
 
   testdat = dlsym(sohandle, "testdat");
   if (testdat->next == -1) abort();
 
   ret = dlclose(sohandle);
 
   return 0;
} 

and this is the shared object:

shareddata.c:
struct testdat {
   void *next;
} testdat;

Compile and run with:
  gcc -shared -O2 -fpic shareddata.c -o shareddata.so
  gcc -O2 -ldl testshareddata.c -o testshareddata
  ./testshareddata

This testcase aborts on PPC and apache uses a similar sequence during start, 
it tests testdat->next and doesn't correctly register the module if it is !=0.

Appended the readelf output for shareddata.so.

Franz.


More information about the Libc-alpha mailing list