david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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>
This commit is contained in:
Michael Brown 2017-05-19 12:21:18 +01:00
parent 7457bfc5b2
commit de37652044
1 changed files with 8 additions and 2 deletions

View File

@ -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;