From 6fec1c7e1118add3aa16707914ada8adca09bf1b Mon Sep 17 00:00:00 2001 From: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Date: Tue, 11 Jun 2019 13:11:48 +0200 Subject: firmware: add missing linker sections to fw_base.ldS The linker sections .sdata and .sbss are missing from the linker script fw_base.ldS. Add them to the .data and .bss sections. On current builds, most variables are in the .sbss section. They are not correctly initialized to zero, because they are not within the boundaries indicated by _bss_start and _bss_end. Currently, this does not cause any issues, however with relocation support lock-ups may occur due to incorrectly initialized lock variables. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Acked-by: Anup Patel <anup.patel@wdc.com> --- firmware/fw_base.ldS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'firmware') diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS index 84d3758..0ac75f2 100644 --- a/firmware/fw_base.ldS +++ b/firmware/fw_base.ldS @@ -50,6 +50,8 @@ { PROVIDE(_data_start = .); + *(.sdata) + *(.sdata.*) *(.data) *(.data.*) *(.readmostly.data) @@ -64,6 +66,8 @@ .bss : { PROVIDE(_bss_start = .); + *(.sbss) + *(.sbss.*) *(.bss) *(.bss.*) . = ALIGN(8); -- cgit v1.2.3