zipl/boot: discard .eh_frame and .interp input sections

The ELF section `.eh_frame` is used for frame unwinding during, for
example, exception handling and the section `.interp` is used by the
program interpreter. [1] Since no frame unwinding nor a program
interpreter is used for the bootloaders we can discard these input
section.

The content of the (exec|bin) files don't change after this change.

[1] https://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/specialsections.html

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2022-12-09 15:46:13 +00:00
committed by Jan Höppner
parent 4aa5534f1d
commit 746a703079
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -88,6 +88,11 @@ SECTIONS
}
__stack_end = .;
.eh_frame : { *(.eh_frame) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
/* Sections to be discarded */
/DISCARD/ : {
*(.eh_frame)
*(.interp)
}
}
+6 -1
View File
@@ -39,7 +39,6 @@ SECTIONS
__ex_table_start = .;
.ex_table : { *(.ex_table) }
__ex_table_stop = .;
.eh_frame : { *(.eh_frame) }
__bss_start = .;
.bss : { *(.bss) }
@@ -75,4 +74,10 @@ SECTIONS
.notes : {
*(.note.*)
}
/* Sections to be discarded */
/DISCARD/ : {
*(.eh_frame)
*(.interp)
}
}