]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[build] Fix %.licence build target
authorMichael Brown <mcb30@ipxe.org>
Mon, 15 Jul 2013 22:08:50 +0000 (00:08 +0200)
committerMichael Brown <mcb30@ipxe.org>
Mon, 15 Jul 2013 22:50:54 +0000 (00:50 +0200)
commitca319873bf43d5d955cc3d8770b5b2415798907d
tree8168679666b92de3de4ab5f4453c8383b22bc103
parent9978e2cb3725c716169ade674c18376b1a401219
[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>
src/Makefile.housekeeping
src/arch/i386/scripts/i386-kir.lds
src/arch/i386/scripts/i386.lds
src/arch/i386/scripts/linux.lds
src/arch/x86/scripts/efi.lds
src/arch/x86_64/scripts/linux.lds
src/include/compiler.h