Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/gnu



On Thu, Feb 10, 2011 at 07:18:30AM +0000, Matt Thomas wrote:
> Module Name:  src
> Committed By: matt
> Date:         Thu Feb 10 07:18:29 UTC 2011
> 
> Modified Files:
>       src/gnu/dist/gcc4/gcc: config.gcc
>       src/gnu/dist/gcc4/gcc/config/rs6000: netbsd.h
>       src/gnu/usr.bin/gcc4/arch/powerpc: tm.h
> 
> Log Message:
> Default NetBSD to -msecure-plt now.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.21 -r1.22 src/gnu/dist/gcc4/gcc/config.gcc
> cvs rdiff -u -r1.4 -r1.5 src/gnu/dist/gcc4/gcc/config/rs6000/netbsd.h
> cvs rdiff -u -r1.4 -r1.5 src/gnu/usr.bin/gcc4/arch/powerpc/tm.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

I just identified this change as the one that's preventing the building of
shared libs which work on my macppc.  The problem was identified by pooka
while troubleshooting some rump stuff on one of my systems;  on a system
built with this change, one of the tests in /usr/tests/toolchain/cc fails.
When the system is built without -msecure-plt the default, it succeeds.

The test creates two src files, building one as a shared lib:

cat > test.c << EOF
#include <stdlib.h>
int main(void) {callpic();exit(0);}
EOF
        cat > pic.c << EOF
#include <stdio.h>
int callpic(void) {printf("hello world\n");}
EOF

Then:
            cc -fPIC -dPIC -shared -o libtest.so pic.c
            cc -o hello test.c -L. -ltest

env LD_LIBRARY_PATH=. ./hello

...which segfaults if the toolchain was built with -msecure-plt.

Thoughts?

+j



Home | Main Index | Thread Index | Old Index