mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [PATCH 4/5] efi: include and execute exit calls
Date: Mon, 23 Jan 2017 18:02:17 +0100	[thread overview]
Message-ID: <20170123170218.25139-5-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20170123170218.25139-1-m.olbrich@pengutronix.de>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 arch/efi/Makefile                 | 4 ++--
 arch/efi/efi/efi-image.c          | 2 ++
 arch/efi/lib/elf_x86_64_efi.lds.S | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/efi/Makefile b/arch/efi/Makefile
index b078bd0e356d..32a1c152b791 100644
--- a/arch/efi/Makefile
+++ b/arch/efi/Makefile
@@ -28,8 +28,8 @@ cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@	\
 quiet_cmd_efi_image = EFI-IMG $@
       cmd_efi_image = $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
 		      -j .dynsym -j .rel -j .rela -j .reloc -j __barebox_initcalls \
-		      -j __barebox_cmd -j .barebox_magicvar -j .bbenv.* \
-		      --target=$(TARGET) $< $@
+		      -j __barebox_exitcalls -j __barebox_cmd -j .barebox_magicvar \
+		      -j .bbenv.* --target=$(TARGET) $< $@
 
 KBUILD_BINARY := barebox
 
diff --git a/arch/efi/efi/efi-image.c b/arch/efi/efi/efi-image.c
index 32e060886a33..c780cad6d447 100644
--- a/arch/efi/efi/efi-image.c
+++ b/arch/efi/efi/efi-image.c
@@ -145,6 +145,7 @@ static int efi_execute_image(const char *file)
 		loaded_image->load_options = xstrdup_char_to_wchar(options);
 		loaded_image->load_options_size =
 			(strlen(options) + 1) * sizeof(wchar_t);
+		shutdown_barebox();
 	}
 
 	efiret = BS->start_image(handle, NULL, NULL);
@@ -255,6 +256,7 @@ static int do_bootm_efi(struct image_data *data)
 	efi_set_variable_usec("LoaderTimeExecUSec", &efi_systemd_vendor_guid,
 			      get_time_ns()/1000);
 
+	shutdown_barebox();
 	linux_efi_handover(handle, boot_header);
 
 	return 0;
diff --git a/arch/efi/lib/elf_x86_64_efi.lds.S b/arch/efi/lib/elf_x86_64_efi.lds.S
index e1bc2120fabc..93d34d17ab1f 100644
--- a/arch/efi/lib/elf_x86_64_efi.lds.S
+++ b/arch/efi/lib/elf_x86_64_efi.lds.S
@@ -80,6 +80,7 @@ SECTIONS
 		*(.rela.data*)
 		*(.rela.barebox*)
 		*(.rela.initcall*)
+		*(.rela.exitcall*)
 		*(.rela.got)
 		*(.rela.stab)
 	}
-- 
2.11.0


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

  parent reply	other threads:[~2017-01-23 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 17:02 [PATCH 0/5] EFI fixes Michael Olbrich
2017-01-23 17:02 ` [PATCH 1/5] readkey: keys are unsigned char Michael Olbrich
2017-01-23 17:02 ` [PATCH 2/5] serial: efi: improve input handling Michael Olbrich
2017-01-23 17:02 ` [PATCH 3/5] output: use '[0m' to reset colors Michael Olbrich
2017-01-23 17:02 ` Michael Olbrich [this message]
2017-01-23 17:02 ` [PATCH 5/5] efi: don't unload drivers Michael Olbrich
2017-01-24  8:35 ` [PATCH 0/5] EFI fixes 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=20170123170218.25139-5-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox