Index: lib/csu/powerpc/Makefile =================================================================== --- lib/csu/powerpc/Makefile +++ lib/csu/powerpc/Makefile @@ -24,8 +24,14 @@ # directly compiled to .o files. crt1.s: crt1.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c - sed ${SED_FIX_NOTE} ${.TARGET} + ${CC} ${CFLAGS} -S -o ${.TARGET}-tmp ${.CURDIR}/crt1.c + sed ${SED_FIX_NOTE} ${.TARGET}-tmp + + # forces GOT relocation to allow use of secure-plt + awk '/.text/{print; print \ + "\t.globl _GLOBAL_OFFSET_TABLE_\n\ + \t.reloc 0, R_PPC_NONE, _GLOBAL_OFFSET_TABLE_"}1'\ + ${.TARGET}-tmp > ${.TARGET} crt1.o: crt1.s ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s