[rtems commit] spec/aarch64: Only apply SUBALIGN(4) to ILP32

Joel Sherrill joel at rtems.org
Mon Nov 23 15:57:58 UTC 2020


Module:    rtems
Branch:    master
Commit:    1cbe5773abafdb611aaeab9c31e527dae5b856ac
Changeset: http://git.rtems.org/rtems/commit/?id=1cbe5773abafdb611aaeab9c31e527dae5b856ac

Author:    Kinsey Moore <kinsey.moore at oarcorp.com>
Date:      Thu Nov  5 14:02:28 2020 -0600

spec/aarch64: Only apply SUBALIGN(4) to ILP32

The SUBALIGN(4) required on rtemsroset and rtemsrwset for ILP32 builds
was previously present on LP64 builds and causes no issues within RTEMS,
but causes relocation/alignment issues when building libbsd. This
restricts those alignment changes to ILP32 builds.

---

 bsps/aarch64/shared/start/linkcmds.base        | 6 ++++--
 spec/build/bsps/aarch64/a53/linkcmds_ilp32.yml | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bsps/aarch64/shared/start/linkcmds.base b/bsps/aarch64/shared/start/linkcmds.base
index 450c3ba..4bf5b10 100644
--- a/bsps/aarch64/shared/start/linkcmds.base
+++ b/bsps/aarch64/shared/start/linkcmds.base
@@ -43,6 +43,8 @@ STARTUP (start.o)
 
 bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 16;
 
+bsp_set_align = DEFINED (bsp_set_align) ? bsp_set_align : 8;
+
 bsp_stack_exception_size = DEFINED (bsp_stack_exception_size) ? bsp_stack_exception_size : 0;
 bsp_stack_exception_size = ALIGN (bsp_stack_exception_size, bsp_stack_align);
 
@@ -243,7 +245,7 @@ SECTIONS {
 	.got : ALIGN_WITH_INPUT {
 		*(.got.plt) *(.igot.plt) *(.got) *(.igot)
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
-	.rtemsroset : ALIGN_WITH_INPUT SUBALIGN(4) {
+	.rtemsroset : ALIGN_WITH_INPUT SUBALIGN(bsp_set_align) {
 		/* Special FreeBSD linker set sections */
 		__start_set_sysctl_set = .;
 		*(set_sysctl_*);
@@ -297,7 +299,7 @@ SECTIONS {
 	.data1 : ALIGN_WITH_INPUT {
 		*(.data1)
 	} > REGION_DATA AT > REGION_DATA_LOAD
-	.rtemsrwset : ALIGN_WITH_INPUT SUBALIGN(4) {
+	.rtemsrwset : ALIGN_WITH_INPUT SUBALIGN(bsp_set_align) {
 		KEEP (*(SORT(.rtemsrwset.*)))
 		bsp_section_data_end = .;
 	} > REGION_DATA AT > REGION_DATA_LOAD
diff --git a/spec/build/bsps/aarch64/a53/linkcmds_ilp32.yml b/spec/build/bsps/aarch64/a53/linkcmds_ilp32.yml
index ed585f1..085c9c7 100644
--- a/spec/build/bsps/aarch64/a53/linkcmds_ilp32.yml
+++ b/spec/build/bsps/aarch64/a53/linkcmds_ilp32.yml
@@ -60,6 +60,7 @@ content: |
 
   OUTPUT_FORMAT ("elf32-littleaarch64")
   OUTPUT_ARCH (aarch64:ilp32)
+  bsp_set_align = 4;
 
   INCLUDE linkcmds.base
 copyrights:



More information about the vc mailing list