From 525d353403c0c665328ea52416922c82ae2eaac5 Mon Sep 17 00:00:00 2001 From: aozima Date: Tue, 22 Oct 2019 09:47:41 +0800 Subject: [PATCH] fixed linker script and stack align issues. --- bsp/allwinner_tina/link.lds | 4 ++-- bsp/beaglebone/beaglebone_ram.lds | 4 ++-- bsp/imx6sx/cortex-a9/cpu/start_gcc.S | 1 + bsp/imx6sx/cortex-a9/imx6.lds | 4 ++-- bsp/imx6ul/imx6.lds | 6 +++--- bsp/lpc2478/lpc2478_ram.lds | 6 +++--- bsp/qemu-vexpress-a9/link.lds | 6 +++--- bsp/qemu-vexpress-gemini/cpu/start_gcc.S | 1 + bsp/qemu-vexpress-gemini/vexpress.lds | 6 +++--- bsp/raspi2/cpu/start_gcc.S | 1 + bsp/realview-a8/realview.lds | 6 +++--- libcpu/arm/am335x/start_gcc.S | 1 + libcpu/arm/cortex-a/start_gcc.S | 1 + libcpu/arm/cortex-r4/start_gcc.S | 1 + libcpu/arm/realview-a8-vmm/start_gcc.S | 1 + libcpu/arm/zynq7000/start_gcc.S | 1 + 16 files changed, 29 insertions(+), 21 deletions(-) diff --git a/bsp/allwinner_tina/link.lds b/bsp/allwinner_tina/link.lds index eb974dea0..8fb0e9e84 100644 --- a/bsp/allwinner_tina/link.lds +++ b/bsp/allwinner_tina/link.lds @@ -82,8 +82,8 @@ SECTIONS PROVIDE(__dtors_end__ = .); } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -118,7 +118,7 @@ SECTIONS } __data_end = .; - . = ALIGN(4); + . = ALIGN(8); __bss_start = .; .bss : { diff --git a/bsp/beaglebone/beaglebone_ram.lds b/bsp/beaglebone/beaglebone_ram.lds index cf9bf6944..5847cb08d 100644 --- a/bsp/beaglebone/beaglebone_ram.lds +++ b/bsp/beaglebone/beaglebone_ram.lds @@ -57,8 +57,8 @@ SECTIONS PROVIDE(__dtors_end__ = .); } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -66,7 +66,7 @@ SECTIONS } __data_end = .; - . = ALIGN(4); + . = ALIGN(8); __bss_start = .; .bss : { diff --git a/bsp/imx6sx/cortex-a9/cpu/start_gcc.S b/bsp/imx6sx/cortex-a9/cpu/start_gcc.S index 2f16d1680..3ff5a755d 100644 --- a/bsp/imx6sx/cortex-a9/cpu/start_gcc.S +++ b/bsp/imx6sx/cortex-a9/cpu/start_gcc.S @@ -34,6 +34,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept ISR_Stack_Size .byte 0 diff --git a/bsp/imx6sx/cortex-a9/imx6.lds b/bsp/imx6sx/cortex-a9/imx6.lds index e05132025..a889774f8 100644 --- a/bsp/imx6sx/cortex-a9/imx6.lds +++ b/bsp/imx6sx/cortex-a9/imx6.lds @@ -65,8 +65,8 @@ SECTIONS . += 16K; } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -74,7 +74,7 @@ SECTIONS } __data_end = .; - . = ALIGN(4); + . = ALIGN(8); __bss_start = .; .bss : { diff --git a/bsp/imx6ul/imx6.lds b/bsp/imx6ul/imx6.lds index d8d748000..a889774f8 100644 --- a/bsp/imx6ul/imx6.lds +++ b/bsp/imx6ul/imx6.lds @@ -65,8 +65,8 @@ SECTIONS . += 16K; } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -74,8 +74,8 @@ SECTIONS } __data_end = .; - . = ALIGN(4); - __bss_start = __data_end; + . = ALIGN(8); + __bss_start = .; .bss : { *(.bss) diff --git a/bsp/lpc2478/lpc2478_ram.lds b/bsp/lpc2478/lpc2478_ram.lds index ffdada7a2..28e8cdd7f 100644 --- a/bsp/lpc2478/lpc2478_ram.lds +++ b/bsp/lpc2478/lpc2478_ram.lds @@ -19,8 +19,8 @@ SECTIONS __rodata_end = .; . = 0xa0100000; + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -28,8 +28,8 @@ SECTIONS } __data_end = .; - . = ALIGN(4); - __bss_start = __data_end; + . = ALIGN(8); + __bss_start = .; .bss : { *(.bss) diff --git a/bsp/qemu-vexpress-a9/link.lds b/bsp/qemu-vexpress-a9/link.lds index 13854a2c0..797cd7e3e 100644 --- a/bsp/qemu-vexpress-a9/link.lds +++ b/bsp/qemu-vexpress-a9/link.lds @@ -67,8 +67,8 @@ SECTIONS PROVIDE(__dtors_end__ = .); } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -76,8 +76,8 @@ SECTIONS } __data_end = .; - . = ALIGN(4); - __bss_start = __data_end; + . = ALIGN(8); + __bss_start = .; .bss : { *(.bss) diff --git a/bsp/qemu-vexpress-gemini/cpu/start_gcc.S b/bsp/qemu-vexpress-gemini/cpu/start_gcc.S index ca8c1f930..0c64d9fec 100644 --- a/bsp/qemu-vexpress-gemini/cpu/start_gcc.S +++ b/bsp/qemu-vexpress-gemini/cpu/start_gcc.S @@ -48,6 +48,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept ISR_Stack_Size .byte 0 diff --git a/bsp/qemu-vexpress-gemini/vexpress.lds b/bsp/qemu-vexpress-gemini/vexpress.lds index 96863d3f8..2e631aa4a 100644 --- a/bsp/qemu-vexpress-gemini/vexpress.lds +++ b/bsp/qemu-vexpress-gemini/vexpress.lds @@ -57,8 +57,8 @@ SECTIONS PROVIDE(__dtors_end__ = .); } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -66,8 +66,8 @@ SECTIONS } __data_end = .; - . = ALIGN(4); - __bss_start = __data_end; + . = ALIGN(8); + __bss_start = .; .bss : { *(.bss) diff --git a/bsp/raspi2/cpu/start_gcc.S b/bsp/raspi2/cpu/start_gcc.S index e64563c91..b60ad6a38 100644 --- a/bsp/raspi2/cpu/start_gcc.S +++ b/bsp/raspi2/cpu/start_gcc.S @@ -48,6 +48,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept ISR_Stack_Size .byte 0 diff --git a/bsp/realview-a8/realview.lds b/bsp/realview-a8/realview.lds index ceaead696..f58622884 100644 --- a/bsp/realview-a8/realview.lds +++ b/bsp/realview-a8/realview.lds @@ -57,8 +57,8 @@ SECTIONS PROVIDE(__dtors_end__ = .); } + . = ALIGN(8); __data_start = .; - . = ALIGN(4); .data : { *(.data) @@ -66,8 +66,8 @@ SECTIONS } __data_end = .; - . = ALIGN(4); - __bss_start = __data_end; + . = ALIGN(8); + __bss_start = .; .bss : { *(.bss) diff --git a/libcpu/arm/am335x/start_gcc.S b/libcpu/arm/am335x/start_gcc.S index 6b76fb04a..7e996e2a8 100644 --- a/libcpu/arm/am335x/start_gcc.S +++ b/libcpu/arm/am335x/start_gcc.S @@ -33,6 +33,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept ISR_Stack_Size .long 0 diff --git a/libcpu/arm/cortex-a/start_gcc.S b/libcpu/arm/cortex-a/start_gcc.S index 91faa0e3f..268cc7ef5 100644 --- a/libcpu/arm/cortex-a/start_gcc.S +++ b/libcpu/arm/cortex-a/start_gcc.S @@ -41,6 +41,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept ISR_Stack_Size .byte 0 diff --git a/libcpu/arm/cortex-r4/start_gcc.S b/libcpu/arm/cortex-r4/start_gcc.S index ab77b9878..a347503ec 100644 --- a/libcpu/arm/cortex-r4/start_gcc.S +++ b/libcpu/arm/cortex-r4/start_gcc.S @@ -36,6 +36,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept (UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + FIQ_Stack_Size + IRQ_Stack_Size) .byte 0 diff --git a/libcpu/arm/realview-a8-vmm/start_gcc.S b/libcpu/arm/realview-a8-vmm/start_gcc.S index 2ec7fe6c8..879cf992a 100644 --- a/libcpu/arm/realview-a8-vmm/start_gcc.S +++ b/libcpu/arm/realview-a8-vmm/start_gcc.S @@ -47,6 +47,7 @@ .globl stack_start .globl stack_top +.align 3 stack_start: .rept ISR_Stack_Size .byte 0 diff --git a/libcpu/arm/zynq7000/start_gcc.S b/libcpu/arm/zynq7000/start_gcc.S index 6904c4558..18056f0ad 100644 --- a/libcpu/arm/zynq7000/start_gcc.S +++ b/libcpu/arm/zynq7000/start_gcc.S @@ -33,6 +33,7 @@ .globl stack_start .globl stack_top +.align 3 .bss stack_start: .rept ISR_Stack_Size -- GitLab