Skip to contentSkip to conversation

firmware: payloads: Optimize usage of "ALIGN"

PATCH New [email protected] 3 participants 3 messages Nov 21, 2022 – Nov 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 firmware: payloads: Optimize usage of "ALIGN"

From: Leizheng Zhang <[email protected]>

Delete the redundant "ALIGN" and adjust the position of "ALIGN"

---
 firmware/fw_base.ldS           | 10 ++++------
 firmware/payloads/test.elf.ldS | 12 +++++-------
 2 files changed, 9 insertions(+), 13 deletions(-)
firmware/fw_base.ldS +4 -6
index 220c043..5ea549f 100644
@@ -24,13 +24,11 @@
 		PROVIDE(_text_end = .);
 	}
 
-	. = ALIGN(0x1000); /* Ensure next section is page aligned */
-
 	/* End of the code sections */
 
-	/* Beginning of the read-only data sections */
+	. = ALIGN(0x1000); /* Ensure next section is page aligned */
 
-	. = ALIGN(0x1000); /* Ensure next section is page aligned */
+	/* Beginning of the read-only data sections */
 
 	.rodata :
 	{
@@ -42,10 +40,10 @@
 
 	/* End of the read-only data sections */
 
-	/* Beginning of the read-write data sections */
-
 	. = ALIGN(0x1000); /* Ensure next section is page aligned */
 
+	/* Beginning of the read-write data sections */
+
 	.data :
 	{
 		PROVIDE(_data_start = .);
firmware/payloads/test.elf.ldS +5 -7
index f3f3242..8d18a9c 100644
@@ -33,13 +33,11 @@ SECTIONS
 		PROVIDE(_text_end = .);
 	}
 
-	. = ALIGN(0x1000); /* Ensure next section is page aligned */
-
 	/* End of the code sections */
 
-	/* Beginning of the read-only data sections */
+	. = ALIGN(0x1000); /* Ensure next section is page aligned */
 
-	. = ALIGN(0x1000); /* Ensure next section is page aligned */
+	/* Beginning of the read-only data sections */
 
 	.rodata :
 	{
@@ -51,10 +49,10 @@ SECTIONS
 
 	/* End of the read-only data sections */
 
-	/* Beginning of the read-write data sections */
-
-	. = ALIGN(0x1000); /* Ensure next section is page aligned */
+	. = ALIGN(0x1000); /* Ensure next section is page aligned */
 
+	/* Beginning of the read-write data sections */
+	
 	.data :
 	{
 		PROVIDE(_data_start = .);
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 firmware: payloads: Optimize usage of "ALIGN"

Quoted 11 lines · On Mon, Nov 21, 2022 at 4:29 PM <[email protected]> wrote:

From: Leizheng Zhang <[email protected]>

Delete the redundant "ALIGN" and adjust the position of "ALIGN"

---
 firmware/fw_base.ldS           | 10 ++++------
 firmware/payloads/test.elf.ldS | 12 +++++-------
 2 files changed, 9 insertions(+), 13 deletions(-)
Applied
#2 lore raw

PATCH v2 1/1 firmware: payloads: Optimize usage of "ALIGN"

In reply to [email protected]
Quoted 6 lines · On Mon, Nov 21, 2022 at 1:58 PM <[email protected]> wrote:

From: Leizheng Zhang <[email protected]>

Delete the redundant "ALIGN" and adjust the position of "ALIGN"

Please carry the Reviewed-by tags which you obtained on your previous patch revision.

For now, I had to manually pull Reviewed-by tags from the previous patch.

Applied this patch to the riscv/opensbi repo.

Regards,
Anup

Quoted 80 lines
---
 firmware/fw_base.ldS           | 10 ++++------
 firmware/payloads/test.elf.ldS | 12 +++++-------
 2 files changed, 9 insertions(+), 13 deletions(-)
firmware/fw_base.ldS +4 -6
index 220c043..5ea549f 100644
@@ -24,13 +24,11 @@
                PROVIDE(_text_end = .);
        }
 
-       . = ALIGN(0x1000); /* Ensure next section is page aligned */
-
        /* End of the code sections */
 
-       /* Beginning of the read-only data sections */
+       . = ALIGN(0x1000); /* Ensure next section is page aligned */
 
-       . = ALIGN(0x1000); /* Ensure next section is page aligned */
+       /* Beginning of the read-only data sections */
 
        .rodata :
        {
@@ -42,10 +40,10 @@
 
        /* End of the read-only data sections */
 
-       /* Beginning of the read-write data sections */
-
        . = ALIGN(0x1000); /* Ensure next section is page aligned */
 
+       /* Beginning of the read-write data sections */
+
        .data :
        {
                PROVIDE(_data_start = .);
firmware/payloads/test.elf.ldS +5 -8
index f3f3242..8d18a9c 100644
@@ -33,13 +33,11 @@ SECTIONS
                PROVIDE(_text_end = .);
        }
 
-       . = ALIGN(0x1000); /* Ensure next section is page aligned */
-
        /* End of the code sections */
 
-       /* Beginning of the read-only data sections */
+       . = ALIGN(0x1000); /* Ensure next section is page aligned */
 
-       . = ALIGN(0x1000); /* Ensure next section is page aligned */
+       /* Beginning of the read-only data sections */
 
        .rodata :
        {
@@ -51,10 +49,10 @@ SECTIONS
 
        /* End of the read-only data sections */
 
-       /* Beginning of the read-write data sections */
-
-       . = ALIGN(0x1000); /* Ensure next section is page aligned */
+       . = ALIGN(0x1000); /* Ensure next section is page aligned */
 
+       /* Beginning of the read-write data sections */
+
        .data :
        {
                PROVIDE(_data_start = .);
--

2.17.1

--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi