From ade3394f119e539b0b5877d5dc6f0cdaf99e52d8 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 26 Jul 2022 13:12:13 -0700 Subject: [PATCH] testsuite: coverage: align rodata section This adds an ALIGN statement to the rodata linker snippet for coverage. Without this, sometimes the section is not aligned, but __init_array_start indicates an aligned address, resulting in incorrect function pointers. So align it. Signed-off-by: Daniel Leung --- subsys/testsuite/coverage/coverage_rodata.ld | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/testsuite/coverage/coverage_rodata.ld b/subsys/testsuite/coverage/coverage_rodata.ld index 02af904d807..08654fba65a 100644 --- a/subsys/testsuite/coverage/coverage_rodata.ld +++ b/subsys/testsuite/coverage/coverage_rodata.ld @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +. = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array*))