Page 1 of 1

Objcopy without EFI targets

Posted: Wed Oct 21, 2020 11:09 am
by PeterX
The GNU-EFI readme writes:
objcopy --help

Verify that the line "supported targets" contains the string
"efi-app-ia32" and "efi-app-x86_64" and that the "-j" option
accepts wildcards.
It names as an functioning example Objcopy 2.24.
But my version (Objcopy 2.35 on Manjaro Linux) doesn't support EFI targets nor -j wildcards.
Do I have to download and build Objcopy (or Binutils) from source now?

Greetings
Peter

Re: Objcopy without EFI targets

Posted: Wed Oct 21, 2020 12:24 pm
by linuxyne
objcopy treats efi-app-ia32 as pei-i386, and efi-app-x86_64 as pei-x86-64. If the pei-* strings are listed as supported targets, that should work. Check convert_efi_target inside binutils.

You might know about [1] and [2].

[3] gives details about the 'inner workings'.

Does any part of the build or execution fail?




[1]: https://wiki.osdev.org/Talk:UEFI_Bare_Bones
[2]: https://wiki.osdev.org/GNU-EFI
[3]: https://github.com/vathpela/gnu-efi/blo ... nuefi#L153

Re: Objcopy without EFI targets

Posted: Wed Oct 21, 2020 12:26 pm
by Octocontrabass
PeterX wrote:GNU-EFI
There may be an easier way.

Re: Objcopy without EFI targets

Posted: Wed Oct 21, 2020 12:38 pm
by PeterX
Octocontrabass wrote:
PeterX wrote:GNU-EFI
There may be an easier way.
Wow thanks! I have to read that thoroughly, but a quick glance looks promising. :) :)

Greetings
Peter

Re: Objcopy without EFI targets

Posted: Wed Oct 21, 2020 11:39 pm
by moonchild
Clang is great, but I don't recommend using c-efi headers. They are buggy and incomplete. Shouldn't be be difficult to use gnu-efi headers anyway, though; just copy them in and add to your include path. (Gnu efi headers also match the spec more closely, which makes it easier to adapt examples.)