[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:
parent
7457bfc5b2
commit
de37652044
|
@ -32,8 +32,14 @@ EFI_HANDLE efi_image_handle;
|
||||||
/** Loaded image protocol for this image */
|
/** Loaded image protocol for this image */
|
||||||
EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
|
EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
|
||||||
|
|
||||||
/** System table passed to entry point */
|
/** System table passed to entry point
|
||||||
EFI_SYSTEM_TABLE *efi_systab;
|
*
|
||||||
|
* 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 */
|
/** EFI shutdown is in progress */
|
||||||
int efi_shutdown_in_progress;
|
int efi_shutdown_in_progress;
|
||||||
|
|
Reference in New Issue