[PATCH v2] firmware: payloads: Optimize usage of "ALIGN"

zhangleizheng at eswincomputing.com zhangleizheng at eswincomputing.com
Mon Nov 21 00:26:22 PST 2022


From: Leizheng Zhang <zhangleizheng at eswincomputing.com>

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

Signed-off-by: Leizheng Zhang <zhangleizheng at eswincomputing.com>
---
 firmware/fw_base.ldS           | 10 ++++------
 firmware/payloads/test.elf.ldS | 12 +++++-------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS
index 220c043..5ea549f 100644
--- a/firmware/fw_base.ldS
+++ b/firmware/fw_base.ldS
@@ -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 = .);
diff --git a/firmware/payloads/test.elf.ldS b/firmware/payloads/test.elf.ldS
index f3f3242..8d18a9c 100644
--- a/firmware/payloads/test.elf.ldS
+++ b/firmware/payloads/test.elf.ldS
@@ -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




More information about the opensbi mailing list