can gcc 2.6.3 compile NON-ELF kernel?

can gcc 2.6.3 compile NON-ELF kernel?

Post by bUrD uPh daAr n0r » Thu, 29 Jun 1995 04:00:00

Hello folks,

        I'm trying to get module support working.  I'm trying to get the
joystick-2.7.3 modules to integrate with kernels 1.2.8 or 1.3.3.  I'm
running gcc-2.6.3.  When I applied the elf patches to either of these
kernel trees and compiled, I got a working kernel, but NO modules
(including those packaged with the kernel!) could find the kernel symbol
table.  I _think_ (just because I have no other explanation) that this is
related to the elf-format kernel.

        Is there any way with gcc-2.6.3 to compile the kernel in a.out
format so that the modules work and find the symbol table?  I tried adding
-b i386-linuxaout to the top level kernel Makefile, but the compilation
still bombs out in a number of places.

        Any suggestions?  I'm trying to get the joystick module into
my kernel so I can start trying to hack joystick support into dosemu.

        Thanks for any info.

/    Joe Waters      | "My center is giving way, my right is pushed back  \

\   Carpe Jugulus    |         /


can gcc 2.6.3 compile NON-ELF kernel?

Post by Mikko A. Suome » Fri, 30 Jun 1995 04:00:00

Believe it or not.. Yes it can :)

Mikko Suomela                          


can gcc 2.6.3 compile NON-ELF kernel?

Post by Thomas Quin » Mon, 03 Jul 1995 04:00:00

Quote:>    Is there any way with gcc-2.6.3 to compile the kernel in a.out

No problem (nor with gcc-2.7.0 either.) Here is a diff against the 1.2.11
source tree : (of course, you have to have an a.out-targeted and a.out-
compatible binutils properly installed...)

diff -ur dist/linux/arch/i386/Makefile linux/arch/i386/Makefile
--- dist/linux/arch/i386/Makefile       Sat Mar  4 14:52:37 1995

 # -qmagic (we need to remove the 32 byte header for bootup purposes)
-ZLINKFLAGS =-qmagic -Ttext 0xfe0
-LINKFLAGS =-qmagic -Ttext 0xfffe0
+# 19950505 -qmagic is ignored by GNU ld
+ZLINKFLAGS =-Ttext 0xfe0
+LINKFLAGS =-Ttext 0xfffe0
 CFLAGS := $(CFLAGS) -pipe
+LD := $(LD) -m i386linux
+CC += -b i486-linuxaout

 ifdef CONFIG_M486
 CFLAGS := $(CFLAGS) -m486
diff -ur dist/linux/arch/i386/kernel/Makefile linux/arch/i386/kernel/Makefile
--- dist/linux/arch/i386/kernel/Makefile        Mon Jan 30 16:46:04 1995

        $(CC) $(CFLAGS) -S $<
-       $(AS) -o $*.o $<
+       $(CC) -c -o $*.o $<
        $(CC) $(CFLAGS) -c $<



1. Help compiling non-ELF objects

I am trying to compile the PHOST distribution for Linux.  It is distibuted
as a bunch of .o files and a couple of libraries(.a files) and a Makefile.

How can I make this compile on Slackware 3.0 using the old libraries and
such?  Do I have to use special CFLAGS or maybe change the path to point
at the stuff I installed for this purpost.  The Slackware 3 distribution
includes packages called "gccaout" and "libaout" that are supposed to
allow me to compile old-style executables.  I just need some help getting
them to run.  I guess???!!!??? :-/


2. unsetenv for Solaris?

3. HELP Compiling *NON*ELF Kernels, Slack 3.0

4. Any help?

5. ELF system - non-ELF program

6. SSH 'No Agent'-error on S.u.S.E. Linux v6.0

7. Can ELF programs load non-ELF libraries?

8. Q. about init scripts

9. What are ELF binaries and how do they differ from non-ELF binaries?

10. Problem: Compiling kernel w/ gcc-elf

11. error compiling kernel after upgraded to gcc 2.7.0 and elf lib 5.0.9

12. gcc - ELF problem compiling kernel.

13. Compiling kernel 1.2.13 under ELF GCC