cant link 2.4.20-gr (compile error)

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

cant link 2.4.20-gr (compile error)

Postby false » Tue May 06, 2003 1:43 pm

Hi!

I'm getting errors when linking 2.4.20 kernel with grsecurity 1.9.9g on generic RH7.2.

It links well without grsecurity patch. When I turn grsecurity off, it links well too.

One noticable thing is that loadable modules are off and there's a lot options turned on (bzImage would have somthing about 1.2MB).

[root@unit9 linux-2.4.20]# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2)
[root@unit9 linux-2.4.20]# ld -v
GNU ld version 2.11.90.0.8 (with BFD 2.11.90.0.8)

tail from `make bzImage`:
nm vmlinux | grep -v '\(compiled\)\|\(\.o$\)\|\( [aUw] \)\|\(\.\.ng$\)\|\(LASH[RL]DI\)' | sort > System.map
make[1]: Wchodzê katalog `/usr/src/linux-2.4.20/arch/i386/boot'
gcc -E -D__KERNEL__ -I/usr/src/linux-2.4.20/include -D__BIG_KERNEL__ -D__ASSEMBLY__ -traditional -DSVGA_MODE=NO
as -o bsetup.o bsetup.s
bsetup.s: Assembler messages:
bsetup.s:1555: Warning: indirect lcall without `*'
ld -m elf_i386 -Ttext 0x0 -s --oformat binary -e begtext -o bsetup bsetup.o
make[2]: Wchodzê katalog `/usr/src/linux-2.4.20/arch/i386/boot/compressed'
tmppiggy=_tmp_$$piggy; \
rm -f $tmppiggy $tmppiggy.gz $tmppiggy.lnk; \
objcopy -O binary -R .note -R .comment -S /usr/src/linux-2.4.20/vmlinux $tmppiggy; \
gzip -f -9 < $tmppiggy > $tmppiggy.gz; \
echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data
ld -m elf_i386 -r -o piggy.o -b binary $tmppiggy.gz -b elf32-i386 -T $tmppiggy.lnk; \
rm -f $tmppiggy $tmppiggy.gz $tmppiggy.lnk
BFD: Warning: Writing section `.data.startup' to huge (ie negative) file offset 0xc0100000.
BFD: Warning: Writing section `__ex_table' to huge (ie negative) file offset 0xc0100010.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset 0xc01017a0.
BFD: Warning: Writing section `.data.cacheline_aligned' to huge (ie negative) file offset 0xc0119660.
BFD: Warning: Writing section `.data.init_task' to huge (ie negative) file offset 0xc011b720.
BFD: Warning: Writing section `.data.page_aligned' to huge (ie negative) file offset 0xc011e000.
BFD: Warning: Writing section `.bss' to huge (ie negative) file offset 0xc0123000.
BFD: Warning: Writing section `.data.init' to huge (ie negative) file offset 0xc0153000.
BFD: Warning: Writing section `.setup.init' to huge (ie negative) file offset 0xc017c260.
BFD: Warning: Writing section `.initcall.init' to huge (ie negative) file offset 0xc017c3c0.
BFD: Warning: Writing section `.text.init' to huge (ie negative) file offset 0xc017c4c8.
BFD: Warning: Writing section `.rodata' to huge (ie negative) file offset 0xc0590000.
BFD: Warning: Writing section `.rodata.page_aligned' to huge (ie negative) file offset 0xc05d5e00.
objcopy: _tmp_31351piggy: File truncated
ld -m elf_i386 -Ttext 0x100000 -e startup_32 -o bvmlinux head.o misc.o piggy.o
make[2]: Opuszczam katalog `/usr/src/linux-2.4.20/arch/i386/boot/compressed'
objcopy -O binary -R .note -R .comment -S compressed/bvmlinux compressed/bvmlinux.out
tools/build -b bbootsect bsetup compressed/bvmlinux.out CURRENT > bzImage
Root device is (8, 2)
Boot sector 512 bytes.
Setup is 2520 bytes.
System is 13 kB

I've got no idea what is this, If I dig this up, I'll post it here.


thanks in advance!
bye
[/b]
false
 
Posts: 3
Joined: Tue May 06, 2003 1:20 pm

Postby spender » Tue May 06, 2003 2:10 pm

Upgrade to binutils 2.13. Older binutils have this problem with KERNEXEC (since it modifies the resulting kernel elf image)

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

success!

Postby false » Tue May 06, 2003 2:13 pm

Thanks for your help! It worked with newer binutils!


bye
false
 
Posts: 3
Joined: Tue May 06, 2003 1:20 pm


Return to grsecurity support