From patchwork Sun Mar 20 23:17:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 52158 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C73D93858C83 for ; Sun, 20 Mar 2022 23:17:27 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 7A1E93858C83 for ; Sun, 20 Mar 2022 23:17:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A1E93858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x09.wildebeest.org [172.31.17.139]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 08A3F302FB81; Mon, 21 Mar 2022 00:17:17 +0100 (CET) Received: by reform (Postfix, from userid 1000) id 538A12E81D4B; Mon, 21 Mar 2022 00:17:17 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Subject: [PATCH] tests: Check addsections test binary is 64bit for run-large-elf-file.sh Date: Mon, 21 Mar 2022 00:17:14 +0100 Message-Id: <20220320231714.156219-1-mark@klomp.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Cc: Mark Wielaard Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" The test binary should be 64bit to be able to create 4GB, or larger, ELF files. https://sourceware.org/bugzilla/show_bug.cgi?id=28975 Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 ++++ tests/run-large-elf-file.sh | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index c97ed52e..c195f9f7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2022-03-20 Mark Wielaard + + * run-large-elf-file.sh: Check elf class of addsections binary. + 2021-12-17 Mark Wielaard * run-debuginfod-query-retry.sh: Use /bin/sh instead of /bin/ls. 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 # 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)]