efi: Switch to direct EFI loader creation
* efi-app-x86_64 is a undocumented legacy compatibility target from the early days of EFI. * This opens the door to native arm,arm64 loaders without the gnu-efi 'fake pe' stubs in the future. * This change also clairifies what's happening within the undocumented efi-app-x86_64 * Future as in binutils fixing these: https://sourceware.org/bugzilla/show_bug.cgi?id=26206 https://sourceware.org/bugzilla/show_bug.cgi?id=26218 Change-Id: I60b4a4f5ceb36059033debbe6bf5b01928d6b223 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3016 Reviewed-by: Alex von Gluck IV <[email protected]> Reviewed-by: Adrien Destugues <[email protected]> Reviewed-by: Fredrik Holmqvist <[email protected]>
This commit is contained in:
committed by
Alex von Gluck IV
parent
7e8f3368fa
commit
c17fa27430
+13
-4
@@ -104,7 +104,7 @@ rule BuildEFILoader {
|
||||
|
||||
switch $(TARGET_ARCH) {
|
||||
case x86_64 :
|
||||
OUTPUT_TARGET on $(efiLoader) = efi-app-x86_64 ;
|
||||
OUTPUT_TARGET on $(efiLoader) = pei-x86-64 ;
|
||||
case arm :
|
||||
OUTPUT_TARGET on $(efiLoader) = binary ;
|
||||
case arm64 :
|
||||
@@ -119,9 +119,18 @@ rule BuildEFILoader {
|
||||
actions BuildEFILoader
|
||||
{
|
||||
rm -f $(1)
|
||||
$(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata -j .data \
|
||||
-j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j .dynstr \
|
||||
--output-target=$(OUTPUT_TARGET) $(2) $(1)
|
||||
if [ "$(OUTPUT_TARGET)" = "binary" ]; then
|
||||
# no bfd support, fake efi Pe header
|
||||
$(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata -j .data \
|
||||
-j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j .dynstr \
|
||||
--output-target=$(OUTPUT_TARGET) $(2) $(1)
|
||||
else
|
||||
# bfd supports pe + efi for arch
|
||||
$(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata -j .data \
|
||||
-j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j .dynstr \
|
||||
--output-target=$(OUTPUT_TARGET) \
|
||||
--subsystem=efi-app $(2) $(1)
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user