summaryrefslogtreecommitdiff
path: root/tests/run-large-elf-file.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-large-elf-file.sh')
-rwxr-xr-xtests/run-large-elf-file.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run-large-elf-file.sh b/tests/run-large-elf-file.sh
index 667d24d8..7116de53 100755
--- a/tests/run-large-elf-file.sh
+++ b/tests/run-large-elf-file.sh
@@ -1,5 +1,6 @@
#! /usr/bin/env bash
# Copyright (C) 2019 Red Hat, Inc.
+# Copyright (C) 2022 Mark J. Wielaard <mark@klomp.org>
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -26,6 +27,16 @@ if test $long_bit -ne 64; then
exit 77
fi
+# The test binary also needs to be 64bits itself
+elfclass=64
+testrun ${abs_top_builddir}/src/readelf -h ${abs_builddir}/addsections | grep ELF32 \
+ && elfclass=32
+echo elfclass: $elfclass
+if test $elfclass -ne 64; then
+ echo "Only 64bit binaries can create > 4GB ELF files"
+ exit 77
+fi
+
# These tests need lots of disk space since they test files > 4GB.
# Skip if there just isn't enough (2.5 * 4 = 10GB).
space_available=$[$(stat -f --format="%a*%S" .)/(1024 * 1024 * 1024)]