From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LdASy-0006Ad-1Y for mharc-grub-devel@gnu.org; Fri, 27 Feb 2009 16:41:56 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdASw-0006A3-E9 for grub-devel@gnu.org; Fri, 27 Feb 2009 16:41:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdASu-00069K-M5 for grub-devel@gnu.org; Fri, 27 Feb 2009 16:41:54 -0500 Received: from [199.232.76.173] (port=41110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdASu-00069G-Gz for grub-devel@gnu.org; Fri, 27 Feb 2009 16:41:52 -0500 Received: from mx20.gnu.org ([199.232.41.8]:2110) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LdASt-0001lU-WE for grub-devel@gnu.org; Fri, 27 Feb 2009 16:41:52 -0500 Received: from aybabtu.com ([69.60.117.155]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LdASs-0007QA-8c for grub-devel@gnu.org; Fri, 27 Feb 2009 16:41:50 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1LdALl-0006qL-2W for grub-devel@gnu.org; Fri, 27 Feb 2009 22:34:29 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1LdASp-0001ck-VI for grub-devel@gnu.org; Fri, 27 Feb 2009 22:41:47 +0100 Date: Fri, 27 Feb 2009 22:41:47 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090227214147.GC6167@thorin> References: <20090222005211.GA29483@thorin> <49A11A7F.9060806@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49A11A7F.9060806@gmail.com> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-kernel: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: bugs in loader/i386/pc/multiboot.c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 21:41:54 -0000 On Sun, Feb 22, 2009 at 10:27:27AM +0100, phcoder wrote: > Robert Millan wrote: >> 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? >> > Move it to a separate file and instead of writing e.g. Elf32_Sym write > Elf_Sym then in the top of the file: > #ifdef ELF64 > #define Elf_Sym Elf64_Sym > ... > #else > #define Elf_Sym Elf32_Sym > ... > #endif > And 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 I will try. Does someone have a known-working Multiboot / ELF64 image I can test with? -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."