From ba80c6eaec11bd522db970ba9c4849dcb349c994 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 17 Nov 2021 12:49:18 +0900 Subject: x86_64: do not pass the EFI image handle or system table to relocation The _reloc() function in reloc_x86_64.c is passed with the EFI image handle and system table, but they are unrelated to the relocation. In fact, they are not used at all. Remove them and clean up the assembler code as well. Signed-off-by: Masahiro Yamada Link: https://lore.barebox.org/20211117034918.1226358-6-masahiroy@kernel.org Signed-off-by: Sascha Hauer --- arch/x86/mach-efi/crt0-efi-x86_64.S | 6 +----- arch/x86/mach-efi/reloc_x86_64.c | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/x86/mach-efi/crt0-efi-x86_64.S b/arch/x86/mach-efi/crt0-efi-x86_64.S index aa03106e9c..d23c1fb2d6 100644 --- a/arch/x86/mach-efi/crt0-efi-x86_64.S +++ b/arch/x86/mach-efi/crt0-efi-x86_64.S @@ -47,14 +47,10 @@ _start: lea image_base(%rip), %rdi lea _DYNAMIC(%rip), %rsi - popq %rcx - popq %rdx - pushq %rcx - pushq %rdx call _relocate - popq %rdi popq %rsi + popq %rdi call efi_main addq $8, %rsp diff --git a/arch/x86/mach-efi/reloc_x86_64.c b/arch/x86/mach-efi/reloc_x86_64.c index e83bacb302..f015ae047d 100644 --- a/arch/x86/mach-efi/reloc_x86_64.c +++ b/arch/x86/mach-efi/reloc_x86_64.c @@ -41,9 +41,9 @@ #include -asmlinkage efi_status_t _relocate (long, Elf64_Dyn *, efi_handle_t, efi_system_table_t *); +asmlinkage efi_status_t _relocate(long, Elf64_Dyn *); -efi_status_t _relocate (long ldbase, Elf64_Dyn *dyn, efi_handle_t image, efi_system_table_t *systab) +efi_status_t _relocate(long ldbase, Elf64_Dyn *dyn) { long relsz = 0, relent = 0; Elf64_Rel *rel = 0; -- cgit v1.2.3