summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/efi-stub.c
diff options
context:
space:
mode:
authorArd Biesheuvel2015-01-12 21:28:20 +0100
committerMatt Fleming2015-01-15 22:28:35 +0100
commitddeeefe2dfbe1fa6b116b9362b1bec465b64c873 (patch)
treea79ebafc3c5ac24fabb034b60915fe46d57d3082 /arch/arm64/kernel/efi-stub.c
parentefi: Expose underlying UEFI firmware platform size to userland (diff)
downloadkernel-qcow2-linux-ddeeefe2dfbe1fa6b116b9362b1bec465b64c873.tar.gz
kernel-qcow2-linux-ddeeefe2dfbe1fa6b116b9362b1bec465b64c873.tar.xz
kernel-qcow2-linux-ddeeefe2dfbe1fa6b116b9362b1bec465b64c873.zip
arm64/efi: efistub: Apply __init annotation
This ensures all stub component are freed when the kernel proper is done booting, by prefixing the names of all ELF sections that have the SHF_ALLOC attribute with ".init". This approach ensures that even implicitly emitted allocated data (like initializer values and string literals) are covered. At the same time, remove some __init annotations in the stub that have now become redundant, and add the __init annotation to handle_kernel_image which will now trigger a section mismatch warning without it. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/arm64/kernel/efi-stub.c')
-rw-r--r--arch/arm64/kernel/efi-stub.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c
index d27dd982ff26..f5374065ad53 100644
--- a/arch/arm64/kernel/efi-stub.c
+++ b/arch/arm64/kernel/efi-stub.c
@@ -13,13 +13,13 @@
#include <asm/efi.h>
#include <asm/sections.h>
-efi_status_t handle_kernel_image(efi_system_table_t *sys_table,
- unsigned long *image_addr,
- unsigned long *image_size,
- unsigned long *reserve_addr,
- unsigned long *reserve_size,
- unsigned long dram_base,
- efi_loaded_image_t *image)
+efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table,
+ unsigned long *image_addr,
+ unsigned long *image_size,
+ unsigned long *reserve_addr,
+ unsigned long *reserve_size,
+ unsigned long dram_base,
+ efi_loaded_image_t *image)
{
efi_status_t status;
unsigned long kernel_size, kernel_memsize = 0;