Subject: Re: Adding ELF64 support
To: None <>
From: David S. Miller <>
List: tech-kern
Date: 09/03/1996 03:07:36
   Date: Mon, 02 Sep 1996 18:29:26 +0000
   From: Matt Thomas <>

   In doing so, I cloned exec_elf.c and made a exec_elf64.c.  However
   I'm not really happy with this approach.  

One method I have seen to deal with this is to have only one
exec_elf.c file.  But you change a few things, and compile it twice.

For every Elf32_XXX you have in the sources, change it to:


Then, at the top you do the following:

#ifdef ELF_64BIT
#define ElfW(x) Elf32_x
#define ElfW(x) Elf64_x

(you get the idea)  For arch's which want both 32 bit and 64 bit elf
support, you make the rule for building the exec_elf.c into an object
file handle this by running it once to create exec_elf32.o with normal
$(CC) arguments, then once again to create exec_elf64.o but this time
passing -DELF_64BIT to $(CC).  Then teach the final link makefile rule
to look for these two objects instead of plain exec_elf.o when linking
the kernel.

David S. Miller