coverage: filter out libfdt.o and libelf.o
authorViktor Mitin <viktor.mitin.19@gmail.com>
Thu, 16 May 2019 13:20:16 +0000 (16:20 +0300)
committerJulien Grall <julien.grall@arm.com>
Mon, 20 May 2019 12:29:58 +0000 (13:29 +0100)
While the build system explicitly compiles any .init object without gcov
option, this does not cover the libraries libfdt and libelf. This is
because the two
libraries are built normally and then some sections will have .init
append.

As coverage will be enabled for libfdt, some of the GCOV counters may be
stored in a section that will be stripped after init. On Arm64, this
will reliably result to a crash when 'xencov' will ask to reset the
counters.

Interestingly, on x86, all the counters for libelf seems to be in
sections that will not be renamed so far. Hence, why this was not
discovered before. But this is a latent bug.

As the two libraries can only be used at boot, it is fine to disable
coverage for the entire library.

Reported-by: Viktor Mitin <viktor.mitin.19@gmail.com>
Suggested-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Viktor Mitin <viktor.mitin.19@gmail.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
[julien: Reword commit message]
Signed-off-by: Julien Grall <julien.grall@arm.com>
xen/common/libelf/Makefile
xen/common/libfdt/Makefile

index 5bf8f764f156957232e37a4c822552dd1d04ea6f..3d9e38f27e652c3be474756482ce35299681b3cb 100644 (file)
@@ -1,4 +1,5 @@
 obj-bin-y := libelf.o
+nocov-y += libelf.o
 
 SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
 
index d81f54b6b8e19f21cd36e645ca95a8f936707f6f..c075bbf5462a2b44149147d166889192c76a0877 100644 (file)
@@ -3,6 +3,7 @@ include Makefile.libfdt
 SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
 
 obj-y += libfdt.o
+nocov-y += libfdt.o
 
 CFLAGS += -I$(BASEDIR)/include/xen/libfdt/