[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>
This commit is contained in:
Joshua Oreman
2010-05-26 17:52:44 -07:00
committed by Michael Brown
parent ba27168c2e
commit 2aad3fab23
12 changed files with 48 additions and 98 deletions

View File

@@ -38,24 +38,6 @@ extern void pxe_activate ( struct net_device *netdev );
extern int pxe_deactivate ( void );
extern int pxe_start_nbp ( void );
extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 );
extern int _pxe_api_call_weak ( struct i386_all_regs *ix86 )
__attribute__ (( weak ));
/**
* Dispatch PXE API call weakly
*
* @v ix86 Registers for PXE call
* @ret present Zero if the PXE stack is present, nonzero if not
*
* A successful return only indicates that the PXE stack was available
* for dispatching the call; it says nothing about the success of
* whatever the call asked for.
*/
static inline int pxe_api_call_weak ( struct i386_all_regs *ix86 )
{
if ( _pxe_api_call_weak != NULL )
return _pxe_api_call_weak ( ix86 );
return -1;
}
extern int pxe_api_call_weak ( struct i386_all_regs *ix86 );
#endif /* _PXE_CALL_H */