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 <enjiax.mai@intel.com>
This commit is contained in:
Enjia Mai 2020-12-08 22:42:51 +08:00 committed by Andrew Boie
commit 56f84b60ed

View file

@ -107,6 +107,7 @@ SECTIONS
*(.rodata)
*(.rodata.*)
MMU_PAGE_ALIGN
#include <snippets-rodata.ld>
#ifdef CONFIG_X86_MMU
@ -140,6 +141,10 @@ SECTIONS
_app_smem_num_words = _app_smem_size >> 2;
#endif /* CONFIG_USERSPACE */
/* This should be put here before BSS section, otherwise the .bss.__gcov will
* be put in BSS section. That causes gcov not work properly */
#include <snippets-ram-sections.ld>
SECTION_PROLOGUE(_BSS_SECTION_NAME, (NOLOAD), ALIGN(16))
{
MMU_PAGE_ALIGN
@ -168,7 +173,6 @@ SECTIONS
#include <snippets-rwdata.ld>
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#include <snippets-ram-sections.ld>
#include <linker/common-ram.ld>
#include <linker/cplusplus-ram.ld>
#include <arch/x86/pagetables.ld>