[haiku-development] Re: UEFI boot loader for Haiku

  • From: Jordan Justen <jljusten@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 17 Mar 2013 19:15:01 -0700

On Fri, Mar 15, 2013 at 2:43 AM, Fredrik Holmqvist
<fredrik.holmqvist@xxxxxxxxx> wrote:
> A little status update, I've been trying to get binutils to add PE
> target so objcopy can convert ELF EFI apps to PE apps, but it is not
> going well.

We use a separate tool in edk2 to convert ELF to PE/COFF.
https://github.com/tianocore/edk2/tree/master/BaseTools/Source/C/GenFw
Note, this tool does quite a few other things. ELF=>PE/COFF is not the
main goal.

We do use a special linker script too:
https://github.com/tianocore/edk2/blob/master/BaseTools/Scripts/gcc4.4-ld-script
So, the tool probably doesn't handle every ELF image.

Not sure if this is useful. Also, note that the code is BSD licensed.

-Jordan

> In buildtools/build-gcc4-optional-package-Haiku.sh I'd expect to add
> '--enable-targets=[possible same as
> --target],i586-haiku-pe,x86_64-haiku-pe" and maybe
> "--enable-64-bit-bfd" as I'm hoping to do both 32- and 64-bit. But atm
> it seems I have to do a lot of brute force testing maybe restricting
> to just 32 bit or 64 bit depending on what we are building.
> I understand I'd have to mess with a lot more (gcc and lib) for both
> 32-bit and 64-bit), but I just want objcopy to show that it knows
> those targets atm.
>
> Any pointers or help in this regard would ease my problems, I think
> I'll leave this for later and just focus on being to be able to build
> ELF efi apps and do the PE conversion in Linux.
>
> So progress is slow and frustrating.
>
> Code wise, I think I'll use the same approach as FreeBSD which have
> efi-lib and linker script quite similar to gnu-efi but without a lot
> of magic gnu-efi does to handle many different platforms. gnu-efi has
> a lot of call wrapper macros that FreeBSD avoids.
>
> Please let me know if you can help with anything, my time is rather limited...
>
> /Fredrik Holmqvist, TQH
>

Other related posts: