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 <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
This commit is contained in:
David Karoly
2021-12-14 19:56:21 +00:00
committed by Fredrik Holmqvist
parent 1a7afaa45b
commit f0adfe2a54
@@ -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