All of lore.kernel.org
 help / color / mirror / Atom feed
From: phcoder <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: bugs in loader/i386/pc/multiboot.c
Date: Sun, 22 Feb 2009 10:27:27 +0100	[thread overview]
Message-ID: <49A11A7F.9060806@gmail.com> (raw)
In-Reply-To: <20090222005211.GA29483@thorin>

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
Regard
Vladimir 'phcoder' Serbinenko



  reply	other threads:[~2009-02-22  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-22  0:52 bugs in loader/i386/pc/multiboot.c Robert Millan
2009-02-22  9:27 ` phcoder [this message]
2009-02-27 21:41   ` Robert Millan
2009-02-27 22:01     ` Neal H. Walfield
2009-02-27 23:06       ` Robert Millan
2009-03-01 21:41         ` Neal H. Walfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49A11A7F.9060806@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.