diff --git a/xen/Rules.mk b/xen/Rules.mk index a190ff0ad1..22aca0ac69 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -115,7 +115,9 @@ subdir-all := $(subdir-y) $(subdir-n) $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY -$(obj-$(coverage)): CFLAGS += -fprofile-arcs -ftest-coverage -DTEST_COVERAGE +ifeq ($(coverage),y) +$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage -DTEST_COVERAGE +endif ifeq ($(lto),y) # Would like to handle all object files as bitcode, but objects made from diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile index 5099430600..d62b14fcff 100644 --- a/xen/arch/x86/efi/Makefile +++ b/xen/arch/x86/efi/Makefile @@ -12,3 +12,4 @@ efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(c extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o stub.o: $(extra-y) +nogcov-$(efi) += stub.o