Gcov: Added linker changes needed by Gcov.

This patch adds all the required hooks needed in the linker
script.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
Adithya Baglody 2018-08-31 15:09:26 +05:30 committed by Anas Nashif
parent cb536111a9
commit b57a149828
3 changed files with 18 additions and 11 deletions

View file

@ -156,6 +156,7 @@ config PRIVILEGED_STACK_SIZE
config PRIVILEGED_STACK_TEXT_AREA
int "Privileged stacks text area"
default 256 if (DEBUG || STACK_CANARIES || CODE_DATA_RELOCATION)
default 512 if COVERAGE_GCOV
default 128
depends on ARCH_HAS_USERSPACE
help

View file

@ -42,17 +42,6 @@
}
#endif
#ifdef CONFIG_COVERAGE_GCOV
/* Section needed by gcov when coverage is turned on.*/
SECTION_PROLOGUE (gcov, (OPTIONAL),)
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} GROUP_LINK_IN(ROMABLE_REGION)
#endif /* CONFIG_COVERAGE_GCOV */
SECTION_PROLOGUE (devconfig, (OPTIONAL),)
{
__devconfig_start = .;
@ -105,3 +94,14 @@
KEEP(*(SORT_BY_NAME(".font_entry.*")))
__font_entry_end = .;
} GROUP_LINK_IN(ROMABLE_REGION)
#ifdef CONFIG_COVERAGE_GCOV
/* Section needed by gcov when coverage is turned on.*/
SECTION_PROLOGUE (gcov, (OPTIONAL),)
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} GROUP_LINK_IN(ROMABLE_REGION)
#endif /* CONFIG_COVERAGE_GCOV */

View file

@ -236,6 +236,12 @@ extern char _image_rodata_end[];
extern char _vector_start[];
extern char _vector_end[];
#ifdef CONFIG_COVERAGE_GCOV
extern char __gcov_bss_start[];
extern char __gcov_bss_end[];
extern char __gcov_bss_size[];
#endif /* CONFIG_COVERAGE_GCOV */
/* end address of image, used by newlib for the heap */
extern char _end[];