Detect the presence of R_AARCH64_{ABS64, PREL32} macros
authorDodji Seketeli <dodji@redhat.com>
Wed, 18 Sep 2019 07:16:27 +0000 (09:16 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 18 Sep 2019 07:16:27 +0000 (09:16 +0200)
commitce0d10da914055b759500cc017e59968d258fdbe
tree8197e19adffc68e098915716ecd93075e40f09ed
parente6870326e01ab4cebccf7e15a40a7656557ab3aa
Detect the presence of R_AARCH64_{ABS64, PREL32} macros

The patch:

 "e687032 Support pre and post v4.19 ksymtabs for Linux kernel modules"

introduces the use of the R_AARCH64_{ABS64, PREL32} macros.  However,
some older "elf.h" don't define these.  When compiling on these older
platforms, we thus need to avoid using these new macros.

With this patch, the configure system detects the presence of these
macros and defines the HAVE_R_AARCH64_{ABS64, PREL32}_MACRO macros
accordingly.

Note that just to comply with what's in there in the code already, we
don't directly do "#ifdef R_AARCH64_ABS64", but rather "#ifdef
HAVE_R_AARCH64_ABS64_MACRO", to allow cases where we want to
artificially disable the "feature" at configure time, in the future.

* configure.ac: Define macros HAVE_R_AARCH64_{ABS64, PREL32}_MACRO
if the macros R_AARCH64_{ABS64, PREL32} are present.
* src/abg-dwarf-reader.cc
(read_context::get_ksymtab_format_module): Conditionalize the use
of R_AARCH64_{ABS64, PREL32} using HAVE_R_AARCH64_{ABS64, PREL32}_MACRO.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
configure.ac
src/abg-dwarf-reader.cc