summaryrefslogtreecommitdiffstats
path: root/src/usr/autoboot.c
diff options
context:
space:
mode:
authorJoshua Oreman2010-05-27 02:52:44 +0200
committerMichael Brown2010-05-27 11:19:14 +0200
commit2aad3fab233f0235f9a8f677ae7bb402f1647eb6 (patch)
treec4630d1f9e5a2c9d21b7018c63fe20878d1c00af /src/usr/autoboot.c
parent[efi] Fix link order for elf2efi (diff)
downloadipxe-2aad3fab233f0235f9a8f677ae7bb402f1647eb6.tar.gz
ipxe-2aad3fab233f0235f9a8f677ae7bb402f1647eb6.tar.xz
ipxe-2aad3fab233f0235f9a8f677ae7bb402f1647eb6.zip
[build] Use weak definitions instead of weak declarations
This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr/autoboot.c')
-rw-r--r--src/usr/autoboot.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index acc4efd6..48d1fa60 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -43,6 +43,13 @@ FILE_LICENCE ( GPL2_OR_LATER );
int shutdown_exit_flags = 0;
/**
+ * Perform PXE menu boot when PXE stack is not available
+ */
+__weak int pxe_menu_boot ( struct net_device *netdev __unused ) {
+ return -ENOTSUP;
+}
+
+/**
* Identify the boot network device
*
* @ret netdev Boot network device
@@ -155,7 +162,7 @@ static int netboot ( struct net_device *netdev ) {
buf, sizeof ( buf ) );
pxe_discovery_control =
fetch_uintz_setting ( NULL, &pxe_discovery_control_setting );
- if ( ( strcmp ( buf, "PXEClient" ) == 0 ) && pxe_menu_boot != NULL &&
+ if ( ( strcmp ( buf, "PXEClient" ) == 0 ) &&
setting_exists ( NULL, &pxe_boot_menu_setting ) &&
( ! ( ( pxe_discovery_control & PXEBS_SKIP ) &&
setting_exists ( NULL, &filename_setting ) ) ) ) {