lib/sys/module: Add support for weak symbols
commit373a42433c4bea38d4d93ee749bd4d7f19bded51
authorMatt Fleming <matt.fleming@intel.com>
Thu, 12 Jul 2012 16:39:53 +0000 (12 17:39 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 20 Jul 2012 09:20:18 +0000 (20 10:20 +0100)
tree3a5c905b995521ce8279058f6216d7a1f157bece
parentb93e6bc9bdafc9fa2dc8709dc97fa5e598c7e94d
lib/sys/module: Add support for weak symbols

We need a means of allowing Syslinux derivative-specific functions to
remain unresolved when there is no implementation for them. For
example, unload_pxe() is referenced by common code in com32/lib, but
is only implemented for PXELINUX. By marking unload_pxe() as __weak we
can substitute references with the undefined_symbol() function for
SYSLINUX, EXTLINUX and ISOLINUX. Provided that those references are
never executed everything works fine. However, if code calls actually
calls unload_pxe() from SYSLINUX, EXTLINUX or ISOLINUX an error
message is displayed and execution is halted.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/lib/sys/module/common.c
com32/lib/sys/module/elf_module.c