Problem: Compiling kernel w/ gcc-elf

Problem: Compiling kernel w/ gcc-elf

Post by William S K L » Sat, 11 Mar 1995 11:58:10



Hello guys,

Have anyone sucessfully compiled the kernel using gcc-elf?  I could get
the object files without any problem.  However, when ld tried to link up
the objects to build vmlinux, it failed.  The errors are :

.........
arch/i386/mm/mm.o(.text+0x5ba): undefined reference to `pg0'
arch/i386/mm/mm.o(.text+0x604): undefined reference to `pg0'
kernel/kernel.o(.text+0x19e): undefined reference to `_current'
kernel/kernel.o(.text+0x1ab): undefined reference to `_last_task_used_math'
kernel/kernel.o(.data+0x39c): undefined reference to `sys_call_table'
kernel/kernel.o(.data+0x424): undefined reference to `floppy_track_buffer'
kernel/kernel.o(.data+0x2aac): undefined reference to `swapper_pg_dir'
mm/mm.o(.text+0x7c): undefined reference to `swapper_pg_dir'
mm/mm.o(.text+0x2a0): undefined reference to `swapper_pg_dir'
mm/mm.o(.text+0x2c6): undefined reference to `swapper_pg_dir'
fs/fs.o(.text+0xdfd6): undefined reference to `sys_call_table'
fs/fs.o(.text+0xe956): undefined reference to `sys_call_table'
.........

I have gone thru the .s files produced and found that it was due to the
number of underscore generated by the assembler in front of .data and
.text symbols.  

Does anyone have idea for this problem?

Best Regards.

William LaiA

 
 
 

Problem: Compiling kernel w/ gcc-elf

Post by Thomas Quin » Sun, 12 Mar 1995 02:05:22



Quote:> Have anyone sucessfully compiled the kernel using gcc-elf?

You cannot do that directly. As you remarked, there are problems with
underscores, because ELF does not use the same convention as a.out. There
was a patch (circa 1.1.70 I think) that embedded all references to
external variables in a macro which made the correct translation for the
current compiler, but I believe it needs a thourough clean-up before you
can use it against 1.2.0.

--