Problem linking with GNU ld
Posted: Wed Jul 02, 2008 10:51 am
Hello guys,
We've been linking our "operating system" using GNU ld, which worked well for a while.
Now, the kernel is growing up in size, and when it exceeds ~36KB, ld fails to link it:
A workaround is to use -Os on GCC-compiled objects, making the kernel fiting in about ~34KB. However, this won't work for a long, and of course we want to know why ld is complaining.
I've googled the error message, but I didn't find anything useful.
Here is the ld script we are using:
Any ideas?
Thanks!
We've been linking our "operating system" using GNU ld, which worked well for a while.
Now, the kernel is growing up in size, and when it exceeds ~36KB, ld fails to link it:
Code: Select all
ld --print-map -o jade.krn -T misc/ld.conf source/kernel/main.o source/common/lists.o source/kernel/fpu.o source/kernel/global.o source/kernel/handlers.o source/kernel/intr.o source/kernel/kalloc.o source/kernel/memory.o source/kernel/mutex.o source/kernel/pic.o source/kernel/process.o source/kernel/segments.o source/kernel/shell/shell.o source/kernel/shell/builtin.o source/kernel/shell/exec.o source/kernel/shell/builtin_funcs.o source/kernel/syscall.o source/kernel/time.o source/kernel/intr_asm.o source/kernel/bios.o source/drivers/ata/ata.o source/drivers/fs/dir.o source/drivers/fs/init.o source/drivers/fs/open.o source/drivers/fs/read.o source/drivers/fs/unlink.o source/drivers/fs/write.o source/drivers/fs/misc.o source/drivers/fs/fstat.o source/drivers/sound/sound.o source/drivers/vga/vga.o source/drivers/vga/vga_hw.o source/drivers/kbd/kbd.o source/drivers/serial/serial.o source/ulib/ctype.o source/ulib/curses.o source/ulib/stdio.o source/ulib/string.o source/ulib/unistd.o > map
source/kernel/bios.o(.text+0x8c): In function `bioscall.n1':
: relocation truncated to fit: R_386_16 .data
*** Error code 1
I've googled the error message, but I didn't find anything useful.
Here is the ld script we are using:
Code: Select all
jade-dev>cat misc/ld.conf
OUTPUT_FORMAT(binary)
SECTIONS {
.text 0x7E00 : AT (0) { *(.text) }
.data 0x7E00 + SIZEOF(.text) : AT (SIZEOF(.text)) { *(.data) *(.rodata*) }
.bss : { *(.bss) *(COMMON) }
}
Thanks!