mirror of
https://gitlab.com/qemu-project/ipxe.git
synced 2025-11-03 07:59:06 +08:00
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>
30 lines
339 B
Plaintext
30 lines
339 B
Plaintext
/* -*- 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.*)
|
|
}
|
|
|
|
}
|