mirror of
https://github.com/ipxe/ipxe
synced 2025-12-10 21:41:09 +03:00
[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:
committed by
Michael Brown
parent
ba27168c2e
commit
2aad3fab23
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user