Skip to content

Commit 56f84b6

Browse files
Enjia Maiandrewboie
authored andcommitted
tests: fix some issues when enabling coverage for qemu_x86_64
Fix some issues in linker.ld when enabling coverage report feature for qemu_x86_64 platform: 1. Fix the gcov record data should not be in BSS section. 2. Fix some test case crash due to lack of memory page align before gcov rodata. Signed-off-by: Enjia Mai <[email protected]>
1 parent 8d5a22c commit 56f84b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/arch/x86/intel64/linker.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ SECTIONS
107107
*(.rodata)
108108
*(.rodata.*)
109109

110+
MMU_PAGE_ALIGN
110111
#include <snippets-rodata.ld>
111112

112113
#ifdef CONFIG_X86_MMU
@@ -140,6 +141,10 @@ SECTIONS
140141
_app_smem_num_words = _app_smem_size >> 2;
141142
#endif /* CONFIG_USERSPACE */
142143

144+
/* This should be put here before BSS section, otherwise the .bss.__gcov will
145+
* be put in BSS section. That causes gcov not work properly */
146+
#include <snippets-ram-sections.ld>
147+
143148
SECTION_PROLOGUE(_BSS_SECTION_NAME, (NOLOAD), ALIGN(16))
144149
{
145150
MMU_PAGE_ALIGN
@@ -168,7 +173,6 @@ SECTIONS
168173
#include <snippets-rwdata.ld>
169174
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
170175

171-
#include <snippets-ram-sections.ld>
172176
#include <linker/common-ram.ld>
173177
#include <linker/cplusplus-ram.ld>
174178
#include <arch/x86/pagetables.ld>

0 commit comments

Comments
 (0)