summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/scripts/efi.lds
diff options
context:
space:
mode:
authorMichael Brown2011-02-22 20:36:24 +0100
committerMichael Brown2011-02-22 22:02:00 +0100
commit623469de5d307ee6d762ad30988ffbfbc53741b6 (patch)
treec30f937ccd76d6b1f824a126afd331590dda7e32 /src/arch/x86/scripts/efi.lds
parent[int13] Add missing "static" modifier (diff)
downloadipxe-623469de5d307ee6d762ad30988ffbfbc53741b6.tar.gz
ipxe-623469de5d307ee6d762ad30988ffbfbc53741b6.tar.xz
ipxe-623469de5d307ee6d762ad30988ffbfbc53741b6.zip
[build] Eliminate unused sections at link-time
Use -ffunction-sections, -fdata-sections, and --gc-sections to automatically prune out any unreferenced sections. This saves around 744 bytes (uncompressed) from the rtl8139.rom build. 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.lds4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/arch/x86/scripts/efi.lds b/src/arch/x86/scripts/efi.lds
index d9963ef3..1a16c29b 100644
--- a/src/arch/x86/scripts/efi.lds
+++ b/src/arch/x86/scripts/efi.lds
@@ -54,7 +54,7 @@ SECTIONS {
_data = .;
*(.data)
*(.data.*)
- *(SORT(.tbl.*)) /* Various tables. See include/tables.h */
+ KEEP(*(SORT(.tbl.*))) /* Various tables. See include/tables.h */
_edata = .;
}
@@ -80,6 +80,7 @@ SECTIONS {
.weak 0x0 : {
_weak = .;
*(.weak)
+ *(.weak.*)
_eweak = .;
}
_assert = ASSERT ( ( _weak == _eweak ), ".weak is non-zero length" );
@@ -102,5 +103,6 @@ SECTIONS {
*(.einfo)
*(.einfo.*)
*(.discard)
+ *(.discard.*)
}
}