I'm running kernel 2.6.5-hardened-r3 and after I installed binutils-2.14.90.0.8-r1 every application that I compiled after installing that version of binutils segfaults at startup. The compiled application however, does work on a 2.6.5-gentoo-r1 kernel. I think it has something to with PaX and/or Grsecurity (both are used in the 2.6.5-hardened-r3 kernel). Downgrading binutils to binutils-2.14.90.0.7-r4 fixed the problem. Reproducible: Always Steps to Reproduce: 1. Run kernel 2.6.5-hardened-r3 (or any other kernel with PaX and Grsecurity enabled) 2. emerge =binutils-2.14.90.0.8-r1 3. compile any C program and see it segfaults immediately
Do you have -fomit-frame-pointer in your CFLAGS? If so try to rebuild binutils without it. binutils-2.14.90.0.8-r1.ebuild doesn't strip that flag as i should. This patch fixes it: --- binutils-2.14.90.0.8-r1.ebuild.orig 2004-06-10 22:37:14.385788080 +0200 +++ binutils-2.14.90.0.8-r1.ebuild 2004-06-10 22:21:45.000000000 +0200 @@ -52,7 +52,7 @@ src_compile() { # Generate borked binaries. Bug #6730 - filter-flags "-fomit-frame-pointer -fssa" + filter-flags -fomit-frame-pointer -fssa local myconf= [ ! -z "${CBUILD}" ] && myconf="--build=${CBUILD}"
I tried this, but it doesn't fix the problem. The problem is still exactly the same. I think there is something more wrong, the linker probably creates binaries that violate some sort of PaX or grsecurity option I enabled.
Sounds like bad hardware. That version of binutils is KNOWN to be a good one.
Bad hardware would be very weird, because the problem never came up earlier. I have been able to solve it now, I think that is because of an updated version with a newer version of the grsecurity patches. There was probably a bug in that somewhere, because I have this version of binutils working now.