summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/scripts/efi.lds
diff options
context:
space:
mode:
authorMichael Brown2013-07-16 00:08:50 +0200
committerMichael Brown2013-07-16 00:50:54 +0200
commitca319873bf43d5d955cc3d8770b5b2415798907d (patch)
tree8168679666b92de3de4ab5f4453c8383b22bc103 /src/arch/x86/scripts/efi.lds
parent[legal] Add missing FILE_LICENCE declarations (diff)
downloadipxe-ca319873bf43d5d955cc3d8770b5b2415798907d.tar.gz
ipxe-ca319873bf43d5d955cc3d8770b5b2415798907d.tar.xz
ipxe-ca319873bf43d5d955cc3d8770b5b2415798907d.zip
[build] Fix %.licence build target
Our use of --gc-sections causes the linker to discard the symbols defined by FILE_LICENCE(), meaning that the resulting licence determination is incomplete. We must use the KEEP() directive in the linker script to force the linker to not discard the licence symbols. Using KEEP(*(COMMON)) would be undesirable, since there are some symbols in COMMON which we may wish to discard. Fix by placing symbols defined by PROVIDE_SYMBOL() (which is used by FILE_LICENCE()) into a special ".provided" section, which we then mark with KEEP(). All such symbols are zero-length, so there is no cost in terms of the final binary size. Since the symbols are no longer in COMMON, the linker will reject symbols with the same name coming from multiple objects. We therefore append the object name to the licence symbol, to ensure that it is unique. Reported-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/scripts/efi.lds')
-rw-r--r--src/arch/x86/scripts/efi.lds2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/arch/x86/scripts/efi.lds b/src/arch/x86/scripts/efi.lds
index 1a16c29b..f1049f24 100644
--- a/src/arch/x86/scripts/efi.lds
+++ b/src/arch/x86/scripts/efi.lds
@@ -55,6 +55,8 @@ SECTIONS {
*(.data)
*(.data.*)
KEEP(*(SORT(.tbl.*))) /* Various tables. See include/tables.h */
+ KEEP(*(.provided))
+ KEEP(*(.provided.*))
_edata = .;
}