From: Christian Franke <Christian.Franke@t-online.de>
To: grub-devel@gnu.org
Subject: Building GRUB on platforms without ELF support
Date: Fri, 16 Nov 2007 23:58:14 +0100 [thread overview]
Message-ID: <473E2086.9040502@t-online.de> (raw)
Building GRUB modules requires ELF support in gas and ld. For platforms
where ELF is not the native format, ld may support ELF output. If not
(like on Cywin) some conversion to ELF is necessary.
In general, GNU objcopy allows conversion between object file formats.
Unfortunately, objcopy (and BFD itself) does not include any support for
the conversion of relocation formats (even conversion between ELF
variants do not work). In particular, when converting PE (a COFF
variant) to ELF, objcopy does not abort but silently produces bad
PC-relative relocation offsets. In my first Cygwin patch, there is a
hack to fix this in the GRUB ELF loader.
For specific conversions, fixing this in objcopy itself is easy. But
there is not much chance that such pragmatic patches will be accepted
upstream.
(http://sourceware.org/ml/binutils/2007-10/threads.html#00302)
I have prepared a reduced (~680 LoC) version of objcopy with the PE->ELF
fix added. To support build on non-ELF platforms, I would suggest to add
this to the GRUB codebase. It can be later extended for other platforms
if desired.
Thanks for any comment.
Christian
next reply other threads:[~2007-11-16 22:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 22:58 Christian Franke [this message]
2007-11-18 7:07 ` Building GRUB on platforms without ELF support Robert Millan
2007-11-18 11:35 ` Marco Gerards
2007-11-19 20:29 ` Christian Franke
2007-12-06 12:08 ` Robert Millan
2007-12-06 12:58 ` Christian Franke
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=473E2086.9040502@t-online.de \
--to=christian.franke@t-online.de \
--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.