genprotimg/boot: improve linker scripts

+ the input section names `.text.init` and `.text.start` aren't
   ambiguous, therefore there is no reason so specify a file name
 + discard `.interp` section since no loader is used

Reviewed-by: Steffen Eiden <seiden@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
2023-02-03 19:07:54 +01:00
committed by Jan Höppner
parent 6097ee3f9d
commit d301668811
2 changed files with 9 additions and 11 deletions

View File

@@ -23,8 +23,6 @@ ENTRY(_init)
SECTIONS
{
. = 0x0;
. = HEAP_ADDRESS;
__heap_start = .;
.heap : {
@@ -46,7 +44,7 @@ SECTIONS
. = STAGE3A_INIT_ENTRY;
__text_init_start = .;
.text : {
stage3a_init.o(.text.init)
*(.text.init)
__text_init_stop = ABSOLUTE(.);
/* Text size of text_init must be smaller than 'PARMAREA - IMAGE_ENTRY',
* otherwise the text data could be overwritten by the original zipl stage3
@@ -56,8 +54,8 @@ SECTIONS
. = 0x1000;
ASSERT(ABSOLUTE(.) == STAGE3A_ENTRY,
"Text section doesn't conform to the described memory layout");
head.o(.text.start)
*(.text)
*(.text.start)
*(.text .text.*)
}
.ex_table ALIGN(16) : {
@@ -74,7 +72,7 @@ SECTIONS
.rodata ALIGN(16) : {
*(.rodata)
*(.rodata.*)
*(.rodata*)
}
.data ALIGN(16) : {
@@ -93,6 +91,7 @@ SECTIONS
/* Sections to be discarded */
/DISCARD/ : {
*(.eh_frame)
*(.interp)
*(.note.GNU-stack)
}
}

View File

@@ -21,8 +21,6 @@ ENTRY(_start)
SECTIONS
{
. = 0x0;
. = HEAP_ADDRESS;
__heap_start = .;
.heap : {
@@ -34,8 +32,8 @@ SECTIONS
. = STAGE3B_ENTRY;
.text : {
head.o(.text.start)
*(.text)
*(.text.start)
*(.text .text.*)
}
.ex_table ALIGN(16) : {
@@ -52,7 +50,7 @@ SECTIONS
.rodata ALIGN(16) : {
*(.rodata)
*(.rodata.*)
*(.rodata*)
}
.data ALIGN(16) : {
@@ -77,6 +75,7 @@ SECTIONS
/* Sections to be discarded */
/DISCARD/ : {
*(.eh_frame)
*(.interp)
*(.note.GNU-stack)
}
}