subsys/testsuite/coverage: move initialization vector to RODATA
The .init_array vector is, in fact, read-only data, so put it there. Previously it was placed at the end of the ROM, but was unknown to the x86 memory protection code with XIP enabled (because it was not part of the text, rodata, or kernel RAM). Until recently, the XIP implementation artificially bloated _image_rodata_size to cover the entire ROM, so the (mis)placement of .init_array went unnoticed. Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This commit is contained in:
parent
8a2624c106
commit
155853b39c
|
@ -3,5 +3,4 @@
|
|||
zephyr_sources_ifdef(CONFIG_COVERAGE_GCOV coverage.c)
|
||||
|
||||
zephyr_linker_sources_ifdef(CONFIG_COVERAGE_GCOV RAM_SECTIONS coverage_ram.ld)
|
||||
zephyr_linker_sources_ifdef(CONFIG_COVERAGE_GCOV SECTIONS coverage_rom.ld)
|
||||
|
||||
zephyr_linker_sources_ifdef(CONFIG_COVERAGE_GCOV RODATA coverage_rodata.ld)
|
||||
|
|
9
subsys/testsuite/coverage/coverage_rodata.ld
Normal file
9
subsys/testsuite/coverage/coverage_rodata.ld
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Intel Corporation
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Copied from linker.ld */
|
||||
|
||||
/* Section needed by gcov when coverage is turned on.*/
|
||||
SECTION_PROLOGUE (gcov,,)
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
Loading…
Reference in a new issue