mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl/boot: Improve linker scripts
Output all text input sections into one text section and map all input sections .bss.* .text.*, .rodata.*, and .data.* as it's done by the default linker script [1]. In addition, make the linker script easier to read by replacing the magic value of 32 with 'SIZEOF(.sb.trailer)'. [1] Check the output of 'ld --verbose'. Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> 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:
committed by
Jan Höppner
parent
35e539a428
commit
a1126352ec
@@ -33,15 +33,15 @@ SECTIONS
|
|||||||
__stage2_head = .;
|
__stage2_head = .;
|
||||||
.stage2.head : { *(.stage2.head) }
|
.stage2.head : { *(.stage2.head) }
|
||||||
. = STAGE2_ENTRY;
|
. = STAGE2_ENTRY;
|
||||||
.text.start : {
|
.text : {
|
||||||
*(.text.start)
|
*(.text.start)
|
||||||
|
*(.text .text.*)
|
||||||
}
|
}
|
||||||
.text : { *(.text) }
|
|
||||||
__ex_table_start = .;
|
__ex_table_start = .;
|
||||||
.ex_table : { *(.ex_table) }
|
.ex_table : { *(.ex_table) }
|
||||||
__ex_table_stop = .;
|
__ex_table_stop = .;
|
||||||
.rodata : {*(.rodata) }
|
.rodata : {*(.rodata .rodata.*) }
|
||||||
.data : { *(.data) }
|
.data : { *(.data .data.*) }
|
||||||
|
|
||||||
. = STAGE2DUMP_TAIL_ADDRESS;
|
. = STAGE2DUMP_TAIL_ADDRESS;
|
||||||
.stage2dump.tail : { *(.stage2dump.tail)
|
.stage2dump.tail : { *(.stage2dump.tail)
|
||||||
@@ -59,7 +59,7 @@ SECTIONS
|
|||||||
.eckd2dump_mv.tail : { *(.eckd2dump_mv.tail) }
|
.eckd2dump_mv.tail : { *(.eckd2dump_mv.tail) }
|
||||||
#endif
|
#endif
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss : { *(.bss) }
|
.bss : { *(.bss .bss.*) }
|
||||||
__bss_stop = .;
|
__bss_stop = .;
|
||||||
|
|
||||||
. = ECKD2DUMP_HEAP_ADDRESS;
|
. = ECKD2DUMP_HEAP_ADDRESS;
|
||||||
|
|||||||
@@ -32,22 +32,22 @@ SECTIONS
|
|||||||
. = STAGE2_LOAD_ADDRESS;
|
. = STAGE2_LOAD_ADDRESS;
|
||||||
.stage2.head : { *(.stage2.head) }
|
.stage2.head : { *(.stage2.head) }
|
||||||
. = STAGE2_ENTRY;
|
. = STAGE2_ENTRY;
|
||||||
.text.start : {
|
.text : {
|
||||||
*(.text.start)
|
*(.text.start)
|
||||||
|
*(.text .text.*)
|
||||||
}
|
}
|
||||||
.text : { *(.text) }
|
|
||||||
__ex_table_start = .;
|
__ex_table_start = .;
|
||||||
.ex_table : { *(.ex_table) }
|
.ex_table : { *(.ex_table) }
|
||||||
__ex_table_stop = .;
|
__ex_table_stop = .;
|
||||||
.rodata : {*(.rodata) }
|
.rodata : { *(.rodata .rodata.*) }
|
||||||
.data : { *(.data) }
|
.data : { *(.data .data.*) }
|
||||||
__stage2_params = .;
|
__stage2_params = .;
|
||||||
|
|
||||||
. = STAGE2DUMP_TAIL_ADDRESS;
|
. = STAGE2DUMP_TAIL_ADDRESS;
|
||||||
.stage2dump.tail : { *(.stage2dump.tail) }
|
.stage2dump.tail : { *(.stage2dump.tail) }
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss : { *(.bss) }
|
.bss : { *(.bss .bss.*) }
|
||||||
__bss_stop = .;
|
__bss_stop = .;
|
||||||
|
|
||||||
. = STAGE2_HEAP_ADDRESS;
|
. = STAGE2_HEAP_ADDRESS;
|
||||||
|
|||||||
@@ -34,26 +34,29 @@ SECTIONS
|
|||||||
_stage3_parms = .;
|
_stage3_parms = .;
|
||||||
|
|
||||||
. = STAGE3_ENTRY;
|
. = STAGE3_ENTRY;
|
||||||
.text.start : { *(.text.start) }
|
.text : {
|
||||||
.text : { *(.text) }
|
*(.text.start)
|
||||||
|
*(.text .text.*)
|
||||||
|
}
|
||||||
__ex_table_start = .;
|
__ex_table_start = .;
|
||||||
.ex_table : { *(.ex_table) }
|
.ex_table : { *(.ex_table) }
|
||||||
__ex_table_stop = .;
|
__ex_table_stop = .;
|
||||||
|
|
||||||
__bss_start = .;
|
__bss_start = .;
|
||||||
.bss : { *(.bss) }
|
.bss : { *(.bss .bss.*) }
|
||||||
__bss_stop = .;
|
__bss_stop = .;
|
||||||
.rodata : {*(.rodata) }
|
.rodata : {*(.rodata .rodata.*) }
|
||||||
.data : { *(.data) }
|
.data : { *(.data .data.*) }
|
||||||
|
|
||||||
/* Trailer needed for Secure Boot */
|
/* Trailer needed for Secure Boot */
|
||||||
. = COMMAND_LINE_EXTRA - 32;
|
. = COMMAND_LINE_EXTRA - SIZEOF(.sb.trailer);
|
||||||
.sb.trailer : {
|
.sb.trailer : {
|
||||||
QUAD(0x0000c00000000000)
|
QUAD(0x0000c00000000000)
|
||||||
QUAD(STAGE3_ENTRY + PSW_LOAD)
|
QUAD(STAGE3_ENTRY + PSW_LOAD)
|
||||||
QUAD(STAGE3_ENTRY)
|
QUAD(STAGE3_ENTRY)
|
||||||
QUAD(0x000000207a49504c)
|
QUAD(0x000000207a49504c)
|
||||||
}
|
}
|
||||||
|
ASSERT(SIZEOF(.sb.trailer) == 32, "Invalid .sb.trailer size")
|
||||||
|
|
||||||
. = COMMAND_LINE_EXTRA;
|
. = COMMAND_LINE_EXTRA;
|
||||||
.cmdline_extra : {
|
.cmdline_extra : {
|
||||||
|
|||||||
Reference in New Issue
Block a user