[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub-pe2elf

From: Christian Franke
Subject: Re: grub-pe2elf
Date: Tue, 04 Aug 2009 23:04:23 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090403 SeaMonkey/1.1.16

Robert Millan wrote:
I don't understand what you mean about a "Linux cross-compiler":

  - Why a compiler?  AFAICT, the problem here is assembly/linkage
    rather than compiling.  binutils should suffice.

Unfortunately this is not true:

Some assembly language directives generated by gcc differ between PE and ELF. An ELF 'gas' does not accept assembly output from a PE 'gcc' and vice versa. The whole toolchain must support ELF.

  - It's not really "Linux", just generic ELF support (i.e.
    i386-pc-elf rather than i386-pc-linux-gnu).

OK :-)

  - It's not exactly "cross".  I think something like
    --enable-targets=i386-pc-elf when building binutils should
    work just fine.  This produces an "ld" that understands multiple
    formats (-m switch).  Have you tried this?

Cygwin binutils are build with this option:

$ ld --help
ld: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec tekhex binary ihex

But this does not help because ld refuses to build ELF output from PE input. So you need an ELF gas. Which requires an ELF gcc...

I already described that here:

Christian Franke

reply via email to

[Prev in Thread] Current Thread [Next in Thread]