ld linker error with 2.4.34 and 2.4.35.3

Discuss and suggest new grsecurity features

ld linker error with 2.4.34 and 2.4.35.3

Postby Zerg2000 » Tue Oct 23, 2007 7:37 am

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
Zerg2000
 
Posts: 3
Joined: Tue Oct 23, 2007 6:29 am

Re: ld linker error with 2.4.34 and 2.4.35.3

Postby PaX Team » Tue Oct 23, 2007 12:33 pm

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).
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby Zerg2000 » Wed Oct 24, 2007 11:59 am

That is not a problem, I've downgraded binutils for now.

Thank You for Your time,
Zerg2000
 
Posts: 3
Joined: Tue Oct 23, 2007 6:29 am

Postby PaX Team » Tue Oct 30, 2007 8:20 pm

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?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby Zerg2000 » Wed Oct 31, 2007 10:00 am

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
Zerg2000
 
Posts: 3
Joined: Tue Oct 23, 2007 6:29 am

Postby PaX Team » Wed Oct 31, 2007 11:33 am

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.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm


Return to grsecurity development