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 testcase anad a patch for the __gmon_start__ problem on PPC.


On Tue, 10 Oct 2000, H . J . Lu wrote:

> breaks the PPC binary compibility. I am enclosing a testcase here.
> Under x86
> 
> # make
> gcc -o libfoo2.so -g  -Wl,-soname,libfoo.so -Wl,-rpath,./ -shared -fPIC foo.c
> gcc -o libbar2.so -g  -Wl,-soname,libbar.so -Wl,-rpath,./ -shared -fPIC bar.c libfoo2.so
> gcc -o libfoo1.so -DWEAK_FIRST -g  -Wl,-soname,libfoo.so -Wl,-rpath,./ -shared -fPIC foo.c
> gcc -o libbar1.so -DWEAK_FIRST -g  -Wl,-soname,libbar.so -Wl,-rpath,./ -shared -fPIC bar.c libfoo1.so
> rm -f libfoo.so
> ln -s libfoo1.so libfoo.so
> rm -f libbar.so
> ln -s libbar1.so libbar.so
> gcc -o test1 -DWEAK_FIRST -g  test.c -Wl,-rpath,./ -L. -lbar
> rm -f libfoo.so
> ln -s libfoo2.so libfoo.so
> rm -f libbar.so
> ln -s libbar1.so libbar.so
> gcc -o test2 -g  test.c -Wl,-rpath,./ -L. -lbar
> rm -f libfoo.so
> ln -s libfoo2.so libfoo.so
> rm -f libbar.so
> ln -s libbar2.so libbar.so
> gcc -o test3 -g  test.c -Wl,-rpath,./ -L. -lbar
> rm -f libfoo.so
> ln -s libfoo1.so libfoo.so
> rm -f libbar.so
> ln -s libbar1.so libbar.so
> ./test1
> bar: weak defined first
> foo: weak defined first
> ./test2
> bar: weak defined first
> foo: weak defined first
> ./test3
> bar: weak defined first
> foo: weak defined first
> rm -f libfoo.so
> ln -s libfoo2.so libfoo.so
> rm -f libbar.so
> ln -s libbar2.so libbar.so
> ./test1
> bar: weak undefined first
> foo: weak undefined first
> ./test2
> make: *** [all] Segmentation fault
> ./test3
> bar: weak undefined first
> foo: weak undefined first
> #
> 
> The problem is "first" is changed from weak defined to weak undefined.
> That is why test2 failed when both libfoo.so and libbar.so are changed
> to weak undefined. That is the same thing as __gmon_start__ on PPC. We
> don't see the problem on x86 since WEAK_GMON_START is defined for x86.
> Those 2 changes have no impact on x86 as far as __gmon_start__ is
> concerned. If we want the binary compatibility, we need to put back
> the weak defined __gmon_start__ for all targets where WEAK_GMON_START
> is not defined before. One way to fix it is to provide a PPC initfini.c.

I get the same behaviour on armv4l Linux with:
	[root@zip weak.2]# rpm -q glibc gcc binutils
	glibc-2.1.95-0.titan.a (CVS: Tue Oct 10 2000)
	gcc-2.95.2-1nw7
	binutils-2.10.0.26-1
And with glibc 2.1.2
	[root@stewart-nw13 weak.2]# rpm -q glibc gcc binutils
	glibc-2.1.2-4nw3
	gcc-2.95.2-1nw6
	binutils-2.10.0.29-1

-Rms


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