mirror of
https://github.com/ivoszbg/uniLoader.git
synced 2026-08-15 05:18:32 +00:00
arch: discard runtime-unused metadata sections
The toolchain emits several sections that have no meaning for a flat binary bootloader: .eh_frame DWARF unwind tables (we never unwind) .note.gnu.property BTI/PAC ELF markers (lost at objcopy) .note.gnu.build-id debug identity (lost at objcopy) .comment compiler version string .ARM.attributes ABI metadata Gcc emits roughly 7-8 KB of .eh_frame by default for a build of this size; the others are smaller but equally pointless. Just drop all of them in the linker scripts. Net effect on dreamlte_defconfig w/ empty embedded blobs: 61960 -> ~54000 bytes. Stonks.
This commit is contained in:
1 parent
dab24eacef
commit
3f4eb1b319
2 files changed
+20
No files matched your search
@@ -89,4 +89,14 @@ SECTIONS
|
||||
#ifdef CONFIG_LINUX_KRNL_HEADER_IMG
|
||||
_kernel_size = _stack_end - _start;
|
||||
#endif
|
||||
|
||||
/* size optimization for flat binaries */
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame)
|
||||
*(.eh_frame.*)
|
||||
*(.note.gnu.property)
|
||||
*(.note.gnu.build-id)
|
||||
*(.comment)
|
||||
*(.ARM.attributes)
|
||||
}
|
||||
}
|
||||
@@ -45,4 +45,14 @@ SECTIONS
|
||||
}
|
||||
|
||||
_end = .;
|
||||
|
||||
/* size optimization for flat binaries. */
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame)
|
||||
*(.eh_frame.*)
|
||||
*(.note.gnu.property)
|
||||
*(.note.gnu.build-id)
|
||||
*(.comment)
|
||||
*(.ARM.attributes)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user