summaryrefslogtreecommitdiffstats
path: root/arch/efi
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2017-01-23 18:02:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-24 09:34:11 +0100
commit71f0587f2049397d86e9eee7983bce623de5fb5e (patch)
tree8f75b38dfd51bed60b2460dc104f1f852bb45689 /arch/efi
parent39db674c45b851e5dab019469e34db3f1c2bf6a9 (diff)
downloadbarebox-71f0587f2049397d86e9eee7983bce623de5fb5e.tar.gz
barebox-71f0587f2049397d86e9eee7983bce623de5fb5e.tar.xz
efi: include and execute exit calls
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/efi')
-rw-r--r--arch/efi/Makefile4
-rw-r--r--arch/efi/efi/efi-image.c2
-rw-r--r--arch/efi/lib/elf_x86_64_efi.lds.S1
3 files changed, 5 insertions, 2 deletions
diff --git a/arch/efi/Makefile b/arch/efi/Makefile
index b078bd0e3..32a1c152b 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 32e060886..c780cad6d 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 e1bc2120f..93d34d17a 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)
}