Error linking kernel
Error linking kernel
Hi all,
I've had a problem with building my kernel where I get the error "not enough space for program headers (allocated 5, needed 6)". Im compiling under linux using the attached Makefile...
I've tried everything I can think of, any help would be appreciated... Thanks,
[attachment deleted by admin]
I've had a problem with building my kernel where I get the error "not enough space for program headers (allocated 5, needed 6)". Im compiling under linux using the attached Makefile...
I've tried everything I can think of, any help would be appreciated... Thanks,
[attachment deleted by admin]
Re:Error linking kernel
Just a guess. The error suggests that your running out of space of somekind. You're not trying to put the output file on a full disk are you. Have you tried rebooting in case you've run out of RAM (this happens to me sometimes if I've left the computer on all day).
Did make give you a line number or any other info?
Also it looks like you're using GCC to linnk the objects. I know it can do this but it would be easier for the long run if you used ld directly (i think gcc calls it anyway) to give you more control over the linking process.
Pete
Did make give you a line number or any other info?
Also it looks like you're using GCC to linnk the objects. I know it can do this but it would be easier for the long run if you used ld directly (i think gcc calls it anyway) to give you more control over the linking process.
Pete
Re:Error linking kernel
Not out of disk space ??? I even tried rebooting....
I have attached the complete output from the makefile (I stripped the kernel to 2 files to check that it wasn't too many files).....
I'd prefere it if I could link through the makefile using GCC for ease of use...
Any helkp appreciated
[attachment deleted by admin]
I have attached the complete output from the makefile (I stripped the kernel to 2 files to check that it wasn't too many files).....
I'd prefere it if I could link through the makefile using GCC for ease of use...
Any helkp appreciated
[attachment deleted by admin]
Re:Error linking kernel
Ok, I really need to sort this as I just can't get it to work using LD...
Can anyone tell me if I have any errors in the Makefile????
Can anyone tell me if I have any errors in the Makefile????
Re:Error linking kernel
Do you use a linker script? I've seen a similar error that seems to occur when the virtual and physical addresses of the ELF file are different:
http://my.execpc.com/~geezer/osd/gotchas/index.htm#ld_N
Another idea: say "objdump -h *.o" to list the sections present in all .o files that get linked to form the kernel. Look for any peculiar sections; other than .text, .data, .rodata*, and .bss
http://my.execpc.com/~geezer/osd/gotchas/index.htm#ld_N
Another idea: say "objdump -h *.o" to list the sections present in all .o files that get linked to form the kernel. Look for any peculiar sections; other than .text, .data, .rodata*, and .bss
Re:Error linking kernel
Im not using a Linker Script... Do i still need to do this when im using a Makefile to compile it?
Re:Error linking kernel
Yes. If the virtual and physical addresses of the kernel are different, here's a linker script you can use:chrisa128 wrote: Im not using a Linker Script... Do i still need to do this when im using a Makefile to compile it?
Code: Select all
ENTRY(entry) /* entry point */
phys = 0x100000; /* 1 meg = load (physical) adr of kernel */
virt = 0xC0000000; /* 3 gig = virtual address of kernel */
SECTIONS {
/* kernel code and (ELF only) read-only data */
.text virt : AT(phys) {
/* labels to define start of section: */
g_code = .; _g_code = .;
*(.text)
/* ELF constant data section(s). Note trailing wildcard. */
*(.rodata*)
. = ALIGN(4096);
}
/* kernel data */
.data : AT(phys + (g_data - g_code)) {
g_data = .; _g_data = .;
*(.data)
. = ALIGN(4096);
}
/* kernel BSS */
.bss : AT(phys + (g_bss - g_code)) {
g_bss = .; _g_bss = .;
*(.bss)
*(COMMON) /* "common" variables */
. = ALIGN(4096);
}
/* end of BSS/kernel */
g_end = .; _g_end = .;
}
Re:Error linking kernel
I think this may have worked... It links ok when I don't run it with my Makefile...
Thanks Chris
Thanks Chris
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Error linking kernel
what developping environment do you use ? (Djgpp? Cygwin? linux binutils ?)
Under Wind0ws, make sure your FILES environment variable was large enough to have your tools run ...
Under Wind0ws, make sure your FILES environment variable was large enough to have your tools run ...