Re: Multiple .o files from single .c file - how?

From: David Woodhouse (dwmw2@infradead.org)
Date: Mon Apr 10 2000 - 07:12:40 EST


khc@intrepid.pm.waw.pl said:
> It looks like making stub .c files and #including the real file.h is
> the best approach here. Not that I like the idea of having full C
> source in .h file.

It's ugly, but we already do this.

See arch/sparc64/kernel/binfmt_elf32.c, which redefines a handful of
ELF-related macros, then ends...

#undef start_thread
#define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
#define CONFIG_BINFMT_ELF CONFIG_BINFMT_ELF32
#endif
#undef CONFIG_BINFMT_ELF_MODULE
#ifdef CONFIG_BINFMT_ELF32_MODULE
#define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE
#endif
#define ELF_FLAGS_INIT current->tss.flags |= SPARC_FLAG_32BIT

MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit SparcLinux binaries on the Ultra");
MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");

#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR

#include "../../../fs/binfmt_elf.c"

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:14 EST