mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: barebox@lists.infradead.org
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 5/5] x86_64: do not pass the EFI image handle or system table to relocation
Date: Wed, 17 Nov 2021 12:49:18 +0900
Message-ID: <20211117034918.1226358-6-masahiroy@kernel.org> (raw)
In-Reply-To: <20211117034918.1226358-1-masahiroy@kernel.org>

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 <masahiroy@kernel.org>
---

 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 aa03106e9..d23c1fb2d 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 e83bacb30..f015ae047 100644
--- a/arch/x86/mach-efi/reloc_x86_64.c
+++ b/arch/x86/mach-efi/reloc_x86_64.c
@@ -41,9 +41,9 @@
 
 #include <elf.h>
 
-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;
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2021-11-17  3:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  3:49 [PATCH 0/5] x86: misc cleanups Masahiro Yamada
2021-11-17  3:49 ` [PATCH 1/5] kbuild: remove unneeded -nostdlib flag Masahiro Yamada
2021-11-17  3:49 ` [PATCH 2/5] x86: remove x86-specific cmd_barebox__ Masahiro Yamada
2021-11-17  3:49 ` [PATCH 3/5] x86: stop copying unneeded sections to barebox.efi Masahiro Yamada
2021-11-17  3:49 ` [PATCH 4/5] x86: reuse cmd_objcopy to generate barebox.efi Masahiro Yamada
2021-11-17  3:49 ` Masahiro Yamada [this message]
2021-11-17  7:42 ` [PATCH 0/5] x86: misc cleanups Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211117034918.1226358-6-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git