Kernel Compile Errors: 'undefined reference to' (HELP!)

Kernel Compile Errors: 'undefined reference to' (HELP!)

Post by paul coluc » Tue, 06 Feb 1996 04:00:00



Hello,
   I have been trying to recompile my kernel for the last few days.
I just installed slackware 3.0 (Jan release) with gcc 5.7.0.
I have religiously read the relevant HOWTO's, etc...  I make
config, make dep, make clean.  Finally when I 'make zImage', the
machine churns away for about 20 min, then I get a ton
of the following errors:

*****************
make[1]: Leaving directory `/usr/src/linux/arch/i386/mm'
ld -qmagic -Ttext 0xfffe0 arch/i386/kernel/head.o init/main.o init/version.o \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.o \
        fs/filesystems.a \
        drivers/block/block.a drivers/char/char.a drivers/net/net.a \
        /usr/src/linux/lib/lib.a -o vmlinux
ld: warning: cannot find entry symbol _start; defaulting to 000fffe0
arch/i386/kernel/head.o(.text+0x18): undefined reference to `__edata'
arch/i386/kernel/head.o(.text+0x1d): undefined reference to `__end'
arch/i386/kernel/head.o(.text+0x7f): undefined reference to `_x86'
arch/i386/kernel/head.o(.text+0xa3): undefined reference to `_x86'
arch/i386/kernel/head.o(.text+0xcf): undefined reference to `_x86'
                           ^
                           |
                           |
                cutting out similar errors  (many, many, too many!)
                           |
                           |
                           v
kernel/kernel.o(.data+0x454): undefined reference to `floppy_track_buffer'
kernel/kernel.o(.data+0x2aa0): undefined reference to `swapper_pg_dir'
mm/mm.o(.text+0x7f): undefined reference to `swapper_pg_dir'
mm/mm.o(.text+0x2c0): undefined reference to `swapper_pg_dir'
mm/mm.o(.text+0x2f6): undefined reference to `swapper_pg_dir'
fs/fs.o(.text+0xdd7a): undefined reference to `sys_call_table'
fs/fs.o(.text+0xe6ff): undefined reference to `sys_call_table'
fs/fs.o(.text+0xe95a): undefined reference to `sys_call_table'
fs/fs.o(.text+0xea5b): undefined reference to `sys_call_table'
fs/fs.o(.text+0xec1e): undefined reference to `sys_call_table'
floppy.o(.text+0xc3a): undefined reference to `floppy_track_buffer'
floppy.o(.text+0xc49): undefined reference to `floppy_track_buffer'
floppy.o(.text+0xc50): undefined reference to `floppy_track_buffer'
floppy.o(.text+0x2a88): undefined reference to `floppy_track_buffer'
floppy.o(.text+0x2b56): undefined reference to `floppy_track_buffer'
floppy.o(.text+0x3500): more undefined references to `floppy_track_buffer' follow
make: *** [vmlinux] Error 1

***************
    The system is a dx4-120 PCI, 8MB RAM.  I hve been using Loadlin
to boot to Linux.  Can anyone help me rectify the situation.  I think
there is some problem with gcc on my system...(?)

Thanks for any assistance,
--
Paul Colucci
Computational Fluid Dynamics Laboratory
Dept. Mechanical and Aerospace Engineering
State University of New York at Buffalo

 
 
 

Kernel Compile Errors: 'undefined reference to' (HELP!)

Post by Dr K.I. Trollo » Wed, 07 Feb 1996 04:00:00


This is because you did not specify an ELF kernel. Either say yes to ELF when
running the configure script, or change the following lines in the Makefile:
LD= ld -m i386linux
HOSTCC = gcc -b i486-linuxaout -I$(TOPDIR)/include
CC = gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include

Personally, I opted for an ELF kernel.

---


Computer Officer                                          Tel +44 1223 336506
Department of Chemistry                                   FAX +44 1223 336362
Cambridge University
Lensfield Road
Cambridge, UK
-----------------------------------------------------------------------------
I could prove God statistically.
- George Gallup

 
 
 

Kernel Compile Errors: 'undefined reference to' (HELP!)

Post by Gary Hennig » Wed, 07 Feb 1996 04:00:00



Quote:>Hello,
>   I have been trying to recompile my kernel for the last few days.
>I just installed slackware 3.0 (Jan release) with gcc 5.7.0.
>I have religiously read the relevant HOWTO's, etc...  I make
>config, make dep, make clean.  Finally when I 'make zImage', the
>machine churns away for about 20 min, then I get a ton
>of the following errors:

>*****************
>make[1]: Leaving directory `/usr/src/linux/arch/i386/mm'
>ld -qmagic -Ttext 0xfffe0 arch/i386/kernel/head.o init/main.o init/version.o \
> arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.o \
> fs/filesystems.a \
> drivers/block/block.a drivers/char/char.a drivers/net/net.a \
> /usr/src/linux/lib/lib.a -o vmlinux
>ld: warning: cannot find entry symbol _start; defaulting to 000fffe0
>arch/i386/kernel/head.o(.text+0x18): undefined reference to `__edata'

[more compile errors deleted]

Quote:>***************
>    The system is a dx4-120 PCI, 8MB RAM.  I hve been using Loadlin
>to boot to Linux.  Can anyone help me rectify the situation.  I think
>there is some problem with gcc on my system...(?)

The 1.2.x kernels can NOT be compiled ELF (the default set up in
Slackware 3.0). You must compile/link it in the "old" a.out
format. You need to change to the following

LD = ld -m i386linux
HOSTCC = gcc -b i486-linuxaout
CC = gcc -b i486-linuxaout

in the root Makefile, I think. You have to have some of the a.out GCC
files in order for this to work. Best way to find out is modify the
makefile and try to do the compile. I believe the error message you
receive if you don't have the appropriate GCC a.out utilities makes
that fact obvious.

Gary Hennigan