Guard testing v4.19+ AARCH64 kernel module loading for EL6 support
authorDodji Seketeli <dodji@redhat.com>
Fri, 20 Sep 2019 13:59:56 +0000 (15:59 +0200)
committerDodji Seketeli <dodji@redhat.com>
Fri, 20 Sep 2019 13:59:56 +0000 (15:59 +0200)
commit583bc40deb52e093433df9d4eb2737b879df55c5
treebdda8af1f2541f80740481d1fbde28061168a7d7
parented9492065e1bfa547b33278bcbb033ebf03ac8a9
Guard testing v4.19+ AARCH64 kernel module loading for EL6 support

When analyzing an AARCH64 linux kernel module built with support for
either R_AARCH64_ABS64 or R_AARCH64_PREL32 relocations, we need these
macros to be defined in elf.h (i.e a recent enough version of libelf),
otherwise we cannot properly support those kernel modules using the
scheme that uses the relocation table of the __ksymtab and
__ksymtab_gpl sections to read those sections.

In the future, I think we should automatically fallback to another way
of trying to read those sections if those macros are not defined, and
emit a message hinting at what is happening, when in verbose mode.  I
am keeping it as is for the moment, so that we can get a better case
of the when these macros are not defined and whatnot.

In the mean time, this patch conditionalizes the test that reads a
kernel module build with support for these relocations to avoid
running it on platform that support these relocations.

* tests/test-read-dwarf.cc: Do not run the test on
          PR25007-sdhci.ko if the macros R_AARCH64_PREL32 and
          R_AARCH64_ABS64 are not defined.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
tests/test-read-dwarf.cc