|
From: | phcoder |
Subject: | Re: bugs in loader/i386/pc/multiboot.c |
Date: | Sun, 22 Feb 2009 10:27:27 +0100 |
User-agent: | Thunderbird 2.0.0.19 (X11/20090105) |
Robert Millan wrote:
Move it to a separate file and instead of writing e.g. Elf32_Sym write Elf_Sym then in the top of the file:Hi, The problem with elf64 in our multiboot loader is that it duplicates a lot of code from elf32 and this eventually leads to bitrot. In fact, grub_multiboot_load_elf32 and grub_multiboot_load_elf64 are supposed to be almost identical, and only differ in s/32/64/ references. It'd be fairly simple to resincronize them, but I'd really like to find a way to prevent this from happening again. Does someone have any idea on what would be a good approach?
#ifdef ELF64 #define Elf_Sym Elf64_Sym ... #else #define Elf_Sym Elf32_Sym ... #endifAnd then compile the same file twice, once with -DETLF32 and once with -DELF64. I was actually planning to do the same with my efiemu. If you agree I can do this scheme in both places
Regard Vladimir 'phcoder' Serbinenko
[Prev in Thread] | Current Thread | [Next in Thread] |