From f0adfe2a5426a6d99e37a203467c23d8e701ad88 Mon Sep 17 00:00:00 2001 From: David Karoly Date: Tue, 14 Dec 2021 10:47:45 +0100 Subject: [PATCH] boot/efi: fix dummy reloc for x86 Change-Id: Ia61d593c8d131bd6780688ea932b5b92bd629764 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4748 Tested-by: Commit checker robot Reviewed-by: Fredrik Holmqvist --- .../boot/platform/efi/arch/x86/crt0-efi-x86.S | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/system/boot/platform/efi/arch/x86/crt0-efi-x86.S b/src/system/boot/platform/efi/arch/x86/crt0-efi-x86.S index f9d5191ecb..6d08f9d1d9 100644 --- a/src/system/boot/platform/efi/arch/x86/crt0-efi-x86.S +++ b/src/system/boot/platform/efi/arch/x86/crt0-efi-x86.S @@ -58,19 +58,18 @@ _start: popl %ebx testl %eax,%eax jne .exit - + call efi_main # call app with "image" and "systab" argument .exit: leave ret - + // hand-craft a dummy .reloc section so EFI knows it's a relocatable executable: - - .data -dummy: .long 0 + // we're using relocation type IMAGE_REL_BASED_ABSOLUTE which is ignored #define IMAGE_REL_ABSOLUTE 0 - .section .reloc - .long dummy // Page RVA - .long 10 // Block Size (2*4+2) - .word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy + .section .reloc + .long 0 // Page RVA + .long 12 // Block Size (2*4+2*2) + .word (IMAGE_REL_ABSOLUTE<<12) + 0 + .word (IMAGE_REL_ABSOLUTE<<12) + 0