summaryrefslogtreecommitdiff
path: root/include/efi_loader.h
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2018-06-12 08:48:37 +0300
committerAlexander Graf <agraf@suse.de>2018-07-25 15:57:44 +0300
commit7e21fbca26d18327cf7cabaad08df276a06a07d8 (patch)
tree17629bc8a850f3b4151eda5311640a4f545b8f0c /include/efi_loader.h
parent416e07e2cfcfc18e36c9c83ed3ba52c910bf767d (diff)
downloadu-boot-7e21fbca26d18327cf7cabaad08df276a06a07d8.tar.xz
efi_loader: Rename sections to allow for implicit data
Some times gcc may generate data that is then used within code that may be part of an efi runtime section. That data could be jump tables, constants or strings. In order to make sure we catch these, we need to ensure that gcc emits them into a section that we can relocate together with all the other efi runtime bits. This only works if the -ffunction-sections and -fdata-sections flags are passed and the efi runtime functions are in a section that starts with ".text". Up to now we had all efi runtime bits in sections that did not interfere with the normal section naming scheme, but this forces us to do so. Hence we need to move the efi_loader text/data/rodata sections before the global *(.text*) catch-all section. With this patch in place, we should hopefully have an easier time to extend the efi runtime functionality in the future. Signed-off-by: Alexander Graf <agraf@suse.de> [agraf: Fix x86_64 breakage]
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r--include/efi_loader.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index d837e7b157..a0495db291 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -406,8 +406,8 @@ static inline int guidcmp(const efi_guid_t *g1, const efi_guid_t *g2)
* Use these to indicate that your code / data should go into the EFI runtime
* section and thus still be available when the OS is running
*/
-#define __efi_runtime_data __attribute__ ((section ("efi_runtime_data")))
-#define __efi_runtime __attribute__ ((section ("efi_runtime_text")))
+#define __efi_runtime_data __attribute__ ((section (".data.efi_runtime")))
+#define __efi_runtime __attribute__ ((section (".text.efi_runtime")))
/* Call this with mmio_ptr as the _pointer_ to a pointer to an MMIO region
* to make it available at runtime */