summaryrefslogtreecommitdiff
path: root/tools/build/feature/test-libbfd-buildid.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2020-09-03 19:44:39 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-09-04 20:38:15 +0300
commite71e19a9ea70952a53d58a99971820ce6c1794a8 (patch)
tree164ded28d2a6dc179478b3fa3f9c3078f7da114c /tools/build/feature/test-libbfd-buildid.c
parent59126901f200f5fc907153468b03c64e0081b6e6 (diff)
downloadlinux-e71e19a9ea70952a53d58a99971820ce6c1794a8.tar.xz
tools features: Add feature test to check if libbfd has buildid support
Which is needed by the PE executable support, for instance. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jacek Caban <jacek@codeweavers.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Remi Bernon <rbernon@codeweavers.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build/feature/test-libbfd-buildid.c')
-rw-r--r--tools/build/feature/test-libbfd-buildid.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/build/feature/test-libbfd-buildid.c b/tools/build/feature/test-libbfd-buildid.c
new file mode 100644
index 000000000000..157644b04c05
--- /dev/null
+++ b/tools/build/feature/test-libbfd-buildid.c
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <bfd.h>
+
+int main(void)
+{
+ bfd *abfd = bfd_openr("Pedro", 0);
+ return abfd && (!abfd->build_id || abfd->build_id->size > 0x506564726f);
+}