mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
[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>
This commit is contained in:
@@ -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.*)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user