mirror of
https://github.com/ipxe/ipxe
synced 2026-01-12 00:18:33 +03:00
[build] Work around stray sections introduced by some binutils versions
Some versions of GNU ld (observed with binutils 2.36 on Arch Linux) introduce a .note.gnu.property section marked as loadable at a high address and with non-empty contents. This adds approximately 128MB of garbage to the BIOS .usb disk images. Fix by using a custom linker script for the prefix-only binaries such as the USB disk partition table and MBR, in order to allow unwanted sections to be explicitly discarded. Reported-by: Christian Hesse <mail@eworm.de> Tested-by: Christian Hesse <mail@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
29
src/arch/x86/scripts/prefixonly.lds
Normal file
29
src/arch/x86/scripts/prefixonly.lds
Normal file
@@ -0,0 +1,29 @@
|
||||
/* -*- ld-script -*- */
|
||||
|
||||
/*
|
||||
* Linker script for prefix-only binaries (e.g. USB disk MBR)
|
||||
*
|
||||
*/
|
||||
|
||||
SECTIONS {
|
||||
|
||||
.prefix 0x0 : AT ( 0x0 ) {
|
||||
*(.prefix)
|
||||
}
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.comment)
|
||||
*(.comment.*)
|
||||
*(.note)
|
||||
*(.note.*)
|
||||
*(.eh_frame)
|
||||
*(.eh_frame.*)
|
||||
*(.rel)
|
||||
*(.rel.*)
|
||||
*(.einfo)
|
||||
*(.einfo.*)
|
||||
*(.discard)
|
||||
*(.discard.*)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user