All of lore.kernel.org
 help / color / mirror / Atom feed
* Building GRUB on platforms without ELF support
@ 2007-11-16 22:58 Christian Franke
  2007-11-18  7:07 ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Franke @ 2007-11-16 22:58 UTC (permalink / raw)
  To: grub-devel

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-06 12:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-16 22:58 Building GRUB on platforms without ELF support Christian Franke
2007-11-18  7:07 ` 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

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.