Objcopy without EFI targets

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Objcopy without EFI targets

Post 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
linuxyne
Member
Member
Posts: 211
Joined: Sat Jul 02, 2016 7:02 am

Re: Objcopy without EFI targets

Post 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
Octocontrabass
Member
Member
Posts: 5572
Joined: Mon Mar 25, 2013 7:01 pm

Re: Objcopy without EFI targets

Post by Octocontrabass »

PeterX wrote:GNU-EFI
There may be an easier way.
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Objcopy without EFI targets

Post 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
moonchild
Member
Member
Posts: 73
Joined: Wed Apr 01, 2020 4:59 pm
Libera.chat IRC: moon-child

Re: Objcopy without EFI targets

Post 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.)
Post Reply