Page 1 of 1

ld linker error with 2.4.34 and 2.4.35.3

PostPosted: Tue Oct 23, 2007 7:37 am
by Zerg2000
Hello,

This is from vanilla 2.4.34 kernel patched with grsecurity:

Code: Select all
gcc -E -C -P -I/usr/src/linux-2.4.34/include -D__KERNEL__ -imacros /usr/src/linux-2.4.34/include/linux/config.h -imacros /usr/src/linux-2.4.34/include/asm-i386/segment.h -imacros /usr/src/linux-2.4.34/include/asm-i386/page.h -Ui386 arch/i386/vmlinux.lds.S >arch/i386/vmlinux.lds
ld -m elf_i386 -T /usr/src/linux-2.4.34/arch/i386/vmlinux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o init/version.o init/do_mounts.o \
      --start-group \
      arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o \
       drivers/acpi/acpi.o drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/atm/atm.o drivers/ide/idedriver.o drivers/cdrom/driver.o drivers/pci/driver.o drivers/i2c/i2c.o drivers/video/video.o drivers/usb/usbdrv.o drivers/media/media.o crypto/crypto.o \
      net/network.o \
      grsecurity/grsec.o \
      /usr/src/linux-2.4.34/arch/i386/lib/lib.a /usr/src/linux-2.4.34/lib/lib.a /usr/src/linux-2.4.34/arch/i386/lib/lib.a \
      --end-group \
      -o vmlinux
ld: vmlinux: section `.text' can't be allocated in segment 1
ld: final link failed: Bad value
make: *** [vmlinux] Error 1


Same problem with 2.4.35.3 and grsecurity-2.1.11-2.4.35.3-200710101250.patch

Vanilla kernel compiles ok. There was no problem some moths ago so it is probably because of change in ld.

gcc (GCC) 3.4.6 (Gentoo Hardened 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.10)
GNU ld (GNU Binutils) 2.18
glibc 2.5

Regards

Re: ld linker error with 2.4.34 and 2.4.35.3

PostPosted: Tue Oct 23, 2007 12:33 pm
by PaX Team
Zerg2000 wrote:Vanilla kernel compiles ok. There was no problem some moths ago so it is probably because of change in ld.
yes, it's caused by extra checks in 2.18 and i already fixed vmlinux.lds for 2.6, i'll do it for 2.2/2.4 as well (no idea why i forgot about them, sorry).

PostPosted: Wed Oct 24, 2007 11:59 am
by Zerg2000
That is not a problem, I've downgraded binutils for now.

Thank You for Your time,

PostPosted: Tue Oct 30, 2007 8:20 pm
by PaX Team
Zerg2000 wrote:That is not a problem, I've downgraded binutils for now.

Thank You for Your time,
can you test the new patch i just uploaded?

PostPosted: Wed Oct 31, 2007 10:00 am
by Zerg2000
PaX Team wrote:can you test the new patch i just uploaded?


linux-2.4.35.3 + pax-linux-2.4.35-test10.patch links OK now with GNU ld (GNU Binutils) 2.18 however I didn't check if it boots but these changes shouldn't break anything.

Thanks

PostPosted: Wed Oct 31, 2007 11:33 am
by PaX Team
Zerg2000 wrote:linux-2.4.35.3 + pax-linux-2.4.35-test10.patch links OK now with GNU ld (GNU Binutils) 2.18 however I didn't check if it boots but these changes shouldn't break anything.
actually, it's not all good yet, a KERNEXEC kernel is incorrectly linked, i'm still working on that part.