summaryrefslogtreecommitdiffstats
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown2017-05-19 13:21:18 +0200
committerMichael Brown2017-05-19 13:21:18 +0200
commitde37652044d51a73e8c65353e8b74a3544c54183 (patch)
tree4787c3b202ea6bf2bdaf690a7e2657823c9f7c8b /src/interface
parent[xen] Provide 18 4kB receive buffers to work around xen-netback bug (diff)
downloadipxe-de37652044d51a73e8c65353e8b74a3544c54183.tar.gz
ipxe-de37652044d51a73e8c65353e8b74a3544c54183.tar.xz
ipxe-de37652044d51a73e8c65353e8b74a3544c54183.zip
[efi] Prevent EFI code from being linked in to non-EFI builds
Ensure that efi_systab is an undefined symbol in non-EFI builds. In particular, this prevents users from incorrectly enabling IMAGE_EFI in a BIOS build of iPXE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/efi/efi_init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interface/efi/efi_init.c b/src/interface/efi/efi_init.c
index cfaff606..ed9707f2 100644
--- a/src/interface/efi/efi_init.c
+++ b/src/interface/efi/efi_init.c
@@ -32,8 +32,14 @@ EFI_HANDLE efi_image_handle;
/** Loaded image protocol for this image */
EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
-/** System table passed to entry point */
-EFI_SYSTEM_TABLE *efi_systab;
+/** System table passed to entry point
+ *
+ * We construct the symbol name efi_systab via the PLATFORM macro.
+ * This ensures that the symbol is defined only in EFI builds, and so
+ * prevents EFI code from being incorrectly linked in to a non-EFI
+ * build.
+ */
+EFI_SYSTEM_TABLE * _C2 ( PLATFORM, _systab );
/** EFI shutdown is in progress */
int efi_shutdown_in_progress;