diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-01-12 15:28:20 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2015-01-15 16:28:35 -0500 |
commit | ddeeefe2dfbe1fa6b116b9362b1bec465b64c873 (patch) | |
tree | a79ebafc3c5ac24fabb034b60915fe46d57d3082 /drivers/firmware/efi/libstub/arm-stub.c | |
parent | 2859dff97e54db4795b8b7d9606cb8efcec722ff (diff) |
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 'drivers/firmware/efi/libstub/arm-stub.c')
-rw-r--r-- | drivers/firmware/efi/libstub/arm-stub.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 75ee05964cbc..a1fda71c425a 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c | |||
@@ -17,10 +17,10 @@ | |||
17 | 17 | ||
18 | #include "efistub.h" | 18 | #include "efistub.h" |
19 | 19 | ||
20 | static int __init efi_secureboot_enabled(efi_system_table_t *sys_table_arg) | 20 | static int efi_secureboot_enabled(efi_system_table_t *sys_table_arg) |
21 | { | 21 | { |
22 | static efi_guid_t const var_guid __initconst = EFI_GLOBAL_VARIABLE_GUID; | 22 | static efi_guid_t const var_guid = EFI_GLOBAL_VARIABLE_GUID; |
23 | static efi_char16_t const var_name[] __initconst = { | 23 | static efi_char16_t const var_name[] = { |
24 | 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 0 }; | 24 | 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 0 }; |
25 | 25 | ||
26 | efi_get_variable_t *f_getvar = sys_table_arg->runtime->get_variable; | 26 | efi_get_variable_t *f_getvar = sys_table_arg->runtime->get_variable; |
@@ -164,7 +164,7 @@ efi_status_t handle_kernel_image(efi_system_table_t *sys_table, | |||
164 | * for both archictectures, with the arch-specific code provided in the | 164 | * for both archictectures, with the arch-specific code provided in the |
165 | * handle_kernel_image() function. | 165 | * handle_kernel_image() function. |
166 | */ | 166 | */ |
167 | unsigned long __init efi_entry(void *handle, efi_system_table_t *sys_table, | 167 | unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, |
168 | unsigned long *image_addr) | 168 | unsigned long *image_addr) |
169 | { | 169 | { |
170 | efi_loaded_image_t *image; | 170 | efi_loaded_image_t *image; |