From patchwork Sat Jul 4 11:06:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 138476 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D97214BA798D for ; Sat, 4 Jul 2026 11:07:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D97214BA798D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=SgNMHADG X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 841234BA798D for ; Sat, 4 Jul 2026 11:06:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 841234BA798D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 841234BA798D Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2607:f8b0:4864:20::1029 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783163212; cv=pass; b=Bvvp8ctoQODXV7sAscZaBE4VNDi3tbF/eDYknlkaPpZulaq9PoHd/F/2u9lbL4xd6lvIjS1cjumPsC28Ja8FWVrIRMKcUXfeQIEQ5mkXsrX8qc3k1CxZUJhPwGWAKWX4HoqO4KIdCpeK35Y5LaexMqoXXCco4Xd0yBTT2tnpmbc= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783163212; c=relaxed/simple; bh=FVKgrXbKnX+QzzR3a3WIyUz3tmtKDoAd45z/Hw52qak=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=fWhjEdry5FamCpWvEveiFgj3DciFHnEvC6b6Sr0zFyn31hYeaBZkqlTKqsN8shXBxv0AKKZ+VBsBgHegsRf2otIKH/BwScy1ICQr4jewxHbAzqIbUVTt3O9kxT43iHsFgKIjOF/3UIt7JLxkobmHZSItrO9iNlUk7S7i9iFu8BQ= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=SgNMHADG DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 841234BA798D Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-3804e42ad5fso1633707a91.2 for ; Sat, 04 Jul 2026 04:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783163211; cv=none; d=google.com; s=arc-20260327; b=amvya6/Re9yJz1Myqv0KUkzfMSVt4n3uDsvdICtdBLMqFY7sxUS2xGGVFUOhn+EUSw mf9XR1XrWdGGAw4iVu1RNKAMVGSIKQ65ZYuOl5JqHEZjxn5il0LDfCvYG21wjV7Rt/7O MKrvLDqfZwOO6hfngWJ71/tnCeztfrXFzQe7IUQoWCPIEvSMk/tIC0+YsNlPLB/ocUlT /NCcPpbCim912eAuXpjaUL4+Ee0HChwXeEPhTmf6pnBWu52yCdxhUOd0u9LJilPARse+ EE4JIVE0XUlcSomHVqKP1++cCFUPlMm5NpEqeW1vvQAmt+Wvzg8iGrHG7RaUj8JO2vDu 9iFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=S7q3Bhddt/32gTMNxKCAlqhJu2mUk3Bj6/xYoASGh2M=; fh=I+qhSY5ktf66CLZYyuJDnoh0Kvc4/Q3NDZkgrTQ/yn8=; b=WFh05NDN9Nt4QKqeEOqdzTPMcQVRG3IeV2cJCCaE8EtJ+hE9bzbzb7GmzC/AgBWXpz hC7lS8KoOYC1qUQ/MbNj6RXZyUVM0+4NzgdOy+NY7mF/MlZEm/mYqSuygupZff/po20G 4J9Y1z5llIp7ln5PM9OL0uemlmMHcSH134oYFeBrxF4JvjkFlBGjIF2XlFHkr61uv13D DSaq0Pf4PPdILV8T/MiTgBQx+LNAlM407hPbnf2tfDIFxRfjl/ZGRmFkkhmXDqYP/B/g T3+VT9vad9wq7WtWtAUsPLZmXcGESHQZL50+XvtkG1eEzRr9iuCisWm/VtUCcRnQ+m+O ZSeQ==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783163211; x=1783768011; darn=sourceware.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=S7q3Bhddt/32gTMNxKCAlqhJu2mUk3Bj6/xYoASGh2M=; b=SgNMHADGLjOR1VvfaZFCqKZE21FkDdVsZxVLUUM+w+nrCwlUeHqg0cXhreYLQigp9L Z8gVMkg1qNDI9tZoLfH+2gVzypV/trwwOf8gBOEsqBkAhqHwODOa947o/TLt1qRa7ncu N34qcHZtWWVBhRSAQHBfLTePtgDOH3pz8SSx8phRJVRIlafFaUnFEyveYAADZf+2RIVb ZC1cIxuXQZ7vTITVqqk8oFafGn8LhRMPo9oK8iWLUtks6cRJtOe5hyLI9H9//ZYPJXkN jBZJZVQ68+t2CDYtFPL9gXt5ZvGzK1ihaune1OuQg4W32lUK4h79i2WfnSC3UBeLz7MN ZhJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783163211; x=1783768011; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=S7q3Bhddt/32gTMNxKCAlqhJu2mUk3Bj6/xYoASGh2M=; b=sFRtmvIDHHXkixCL4nQ40Us/a1khExpGEz7x0c1v+7HwlxgNLtzNUmX5iQbkwMNg/Q PxXDSJohUQ9LK4k0wFbdEhjs8+1I1nvEU/Qn4UuIVDawF2n1CfOJwry9R8s5xNwmc71w mx+0Sv3wA7ozGjg0EB2urBfF8KLV3Y5g5eyS/BKVDJpAtuJ3gvvFwGEULT1bBc2JGwPA 13zkVRqxYzeoDjCpqrIr63Txl6uanF59rRo2UslBTIirkUsHnKBe8vCuZMf4D+uLhztp gkr7olPqxLxfRdH+8hOVDm7eyP56eLZRtvgsDokWyL6j8PqqgVcRMssh/uOyfif96p9F iucw== X-Gm-Message-State: AOJu0YzuyrlkNIseUiNaV2bj0eO6Bsffqq3GGsM/DTd4qhTt/hyBSryp k3xckxFcXS1eH+ijn0US+qNNjkDdrqSZ5vx93se06m4ZxxEo5Z0jDPtZSIuOi3Cp6DJSWfk/prp 15+6/TDXwK397QPd1BmVlsC0AWaVIf5Q= X-Gm-Gg: AfdE7cm/bbaNwfk0/aZcuAlJJs4cqjiJ6en82r8mskF+JrKFP8tg6MFDN4nMDkWXEMJ Z8eq2cJHt5FbGKo9t/E0PGoSKKhjvZcT9+Bjjec1MLHMIrq8sg6lFvPwo5p/wD8e0q3ATYdco1a iJNbqX9h1DMicBMnCS0jYzdzu4Y9oKtoehguQgXrtJcUGgwl9BONo3L+OMWWNnb5Im0G2k/jpHt BIEikX3nnD/LXMBS1/N9AqvYK2vQNFyP7tlsXfqtWqdL92wO9X0qXVeZGMyksFV1LTXQF9g X-Received: by 2002:a17:90b:224d:b0:380:7763:3b16 with SMTP id 98e67ed59e1d1-3829eb1d44bmr3014379a91.19.1783163211158; Sat, 04 Jul 2026 04:06:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Sat, 4 Jul 2026 19:06:13 +0800 X-Gm-Features: AVVi8Cch_-DLfi0mA9SnfHmNxwRu5G5SXFoM2SFxs_dFhJ4rNxygqDM4tZIIEJs Message-ID: Subject: [PATCH v3] readelf: Save and dump the original section header values To: Alan Modra Cc: Binutils , Nick Clifton , Jan Beulich X-Spam-Status: No, score=-3009.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org On Sat, Jul 4, 2026 at 11:01 AM H.J. Lu wrote: > > On Sat, Jul 4, 2026 at 8:39 AM H.J. Lu wrote: > > > > On Sat, Jul 4, 2026 at 7:49 AM Alan Modra wrote: > > > > > > On Fri, Jul 03, 2026 at 10:30:14PM +0800, H.J. Lu wrote: > > > > validate_section_info clears the garbage values in the section header > > > > to avoid crash later. Save and dump the original section header values > > > > to make the garbage values in the section header visible when dumping > > > > section headers. > > > > > > I think this would be better done the other way around. ie. have a > > > Elf_Internal_Shdr **sane_section_headers that is initialised to point > > > at entries in section_headers, with sane_section_headers[i] allocated > > > as necessary when needing to correct a bogus header. > > > > > > > I have thought about something similar and decided against it > > since filedata->section_headers is used in many places. However, > > I can change filedata->orig_section_headers to on demand. > > > > -- > > H.J. > > Changes in v2: > > 1. filedata->orig_section_headers is changed to on demand. Changes in v3: 1. Clear filedata->orig_section_headers first. > -- > H.J. > --- > validate_section_info clears the garbage values in the section header > to avoid crash later. Save and dump the original section header values > to make the garbage values in the section header visible when dumping > section headers. > > Note: orig_section_headers, instead of sane_section_headers, is added to > filedata since filedata->section_headers is used in many places. Replace > filedata->section_headers with filedata->sane_section_headers requires > a much bigger change. > > * readelf.c (filedata): Add orig_section_headers. > (save_original_section_header_values): New. > (validate_section_info): Add a pointer to the original section > header and call save_original_section_header_values to save the > original section header values before clearing the section header > fields. > (get_32bit_section_headers): Allocate the original section header > buffer. Pass the original section header pointer to > validate_section_info. > (get_64bit_section_headers): Likewise. > (process_section_headers): Dump the original section header > values if they exist. > (process_relocs): Pass a dummy original section pointer to > validate_section_info. > (free_filedata): Free filedata->orig_section_headers. > * testsuite/binutils-all/corrupt-1.elf.bz2: New file. > * testsuite/binutils-all/corrupt-1.r: Likewise. > * testsuite/binutils-all/readelf.exp: Run corrupt-1.elf test. From 2d16c2a7c0135c4da6c9d061398c7184e82e20fb Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 2 Jul 2026 10:14:10 +0800 Subject: [PATCH v3] readelf: Save and dump the original section header values validate_section_info clears the garbage values in the section header to avoid crash later. Save and dump the original section header values to make the garbage values in the section header visible when dumping section headers. Note: orig_section_headers, instead of sane_section_headers, is added to filedata since filedata->section_headers is used in many places. Replace filedata->section_headers with filedata->sane_section_headers requires a much bigger change. * readelf.c (filedata): Add orig_section_headers. (save_original_section_header_values): New. (validate_section_info): Add a pointer to the original section header and call save_original_section_header_values to save the original section header values before clearing the section header fields. (get_32bit_section_headers): Allocate the original section header buffer. Pass the original section header pointer to validate_section_info. (get_64bit_section_headers): Likewise. (process_section_headers): Dump the original section header values if they exist. (process_relocs): Pass a dummy original section pointer to validate_section_info. (free_filedata): Free filedata->orig_section_headers. * testsuite/binutils-all/corrupt-1.elf.bz2: New file. * testsuite/binutils-all/corrupt-1.r: Likewise. * testsuite/binutils-all/readelf.exp: Run corrupt-1.elf test. Signed-off-by: H.J. Lu --- binutils/readelf.c | 114 ++++++++++++++++-- .../testsuite/binutils-all/corrupt-1.elf.bz2 | Bin 0 -> 81 bytes binutils/testsuite/binutils-all/corrupt-1.r | 3 + binutils/testsuite/binutils-all/readelf.exp | 12 ++ 4 files changed, 119 insertions(+), 10 deletions(-) create mode 100644 binutils/testsuite/binutils-all/corrupt-1.elf.bz2 create mode 100644 binutils/testsuite/binutils-all/corrupt-1.r diff --git a/binutils/readelf.c b/binutils/readelf.c index 2826e0cf195..b93d91a921d 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -282,6 +282,7 @@ typedef struct filedata uint64_t archive_file_size; /* Everything below this point is cleared out by free_filedata. */ Elf_Internal_Shdr * section_headers; + Elf_Internal_Shdr ** orig_section_headers; Elf_Internal_Phdr * program_headers; char * string_table; uint64_t string_table_length; @@ -7848,11 +7849,42 @@ offset_from_vma (Filedata * filedata, uint64_t vma, uint64_t size) return vma; } +/* Save the original section header values. */ + +static void +save_original_section_header_values (Elf_Internal_Shdr *internal, + Elf_Internal_Shdr **orig_internal, + const char *dynamic_tag, + unsigned int i) +{ + /* Return if the original section header values have been saved. */ + if (*orig_internal != NULL) + return; + + *orig_internal = (Elf_Internal_Shdr *) + malloc (sizeof (Elf_Internal_Shdr)); + if (*orig_internal == NULL) + { + if (dynamic_tag) + error (_("Out of memory reading dynamic tag %s\n"), + dynamic_tag); + else + error (_("Out of memory reading %u section headers\n"), i); + return; + } + + /* Save the original section header values. */ + **orig_internal = *internal; +} + + /* Valid section info and clear the invalid fields. */ static void -validate_section_info (Elf_Internal_Shdr *internal, unsigned int i, - Filedata *filedata, bool dynamic, bool probe) +validate_section_info (Elf_Internal_Shdr *internal, + Elf_Internal_Shdr **orig_internal, + unsigned int i, Filedata *filedata, bool dynamic, + bool probe) { const char *dynamic_tag = NULL; const char *dynamicsz_tag = NULL; @@ -7880,6 +7912,10 @@ validate_section_info (Elf_Internal_Shdr *internal, unsigned int i, { warn (_("Ignore the out of range sh_link value of %u for " "section %u\n"), internal->sh_link, i); + /* Save the original section header values before garbage + values are cleared. */ + save_original_section_header_values (internal, orig_internal, + NULL, i); internal->sh_link = 0; } @@ -7888,6 +7924,8 @@ validate_section_info (Elf_Internal_Shdr *internal, unsigned int i, { warn (_("Ignore the out of range sh_info value of %u for " "section %u\n"), internal->sh_info, i); + save_original_section_header_values (internal, orig_internal, + NULL, i); internal->sh_info = 0; } } @@ -7902,6 +7940,8 @@ validate_section_info (Elf_Internal_Shdr *internal, unsigned int i, warn (_("Ignore the out of range sh_entsize value of %" PRIu64 " for section %u\n"), (uint64_t) internal->sh_entsize, i); + save_original_section_header_values (internal, orig_internal, + dynamicent_tag, i); internal->sh_entsize = 0; } @@ -7916,6 +7956,8 @@ validate_section_info (Elf_Internal_Shdr *internal, unsigned int i, else warn (_("Ignore the out of range sh_offset value of %" PRId64 " for section %u\n"), sh_offset, i); + save_original_section_header_values (internal, orig_internal, + dynamic_tag, i); internal->sh_offset = 0; } @@ -7930,6 +7972,8 @@ validate_section_info (Elf_Internal_Shdr *internal, unsigned int i, PRIu64 " for section %u with sh_offset value of %" PRId64 "\n"), (uint64_t) internal->sh_size, i, sh_offset); + save_original_section_header_values (internal, orig_internal, + dynamicsz_tag, i); internal->sh_size = 0; } } @@ -7944,6 +7988,7 @@ get_32bit_section_headers (Filedata * filedata, bool probe) { Elf32_External_Shdr * shdrs; Elf_Internal_Shdr * internal; + Elf_Internal_Shdr ** orig_internal; unsigned int i; unsigned int size = filedata->file_header.e_shentsize; unsigned int num = probe ? 1 : filedata->file_header.e_shnum; @@ -7983,9 +8028,24 @@ get_32bit_section_headers (Filedata * filedata, bool probe) return false; } + filedata->orig_section_headers = (Elf_Internal_Shdr **) + cmalloc (num, sizeof (Elf_Internal_Shdr *)); + if (filedata->orig_section_headers == NULL) + { + if (!probe) + error (_("Out of memory reading %u section headers\n"), num); + free (shdrs); + free (filedata->section_headers); + filedata->section_headers = NULL; + return false; + } + memset (filedata->orig_section_headers, 0, + num * sizeof (Elf_Internal_Shdr *)); + + orig_internal = filedata->orig_section_headers; for (i = 0, internal = filedata->section_headers; i < num; - i++, internal++) + i++, internal++, orig_internal++) { internal->sh_name = BYTE_GET (shdrs[i].sh_name); internal->sh_type = BYTE_GET (shdrs[i].sh_type); @@ -7997,7 +8057,8 @@ get_32bit_section_headers (Filedata * filedata, bool probe) internal->sh_info = BYTE_GET (shdrs[i].sh_info); internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign); internal->sh_entsize = BYTE_GET (shdrs[i].sh_entsize); - validate_section_info (internal, i, filedata, false, probe); + validate_section_info (internal, orig_internal, i, filedata, + false, probe); } free (shdrs); @@ -8011,6 +8072,7 @@ get_64bit_section_headers (Filedata * filedata, bool probe) { Elf64_External_Shdr * shdrs; Elf_Internal_Shdr * internal; + Elf_Internal_Shdr ** orig_internal; unsigned int i; unsigned int size = filedata->file_header.e_shentsize; unsigned int num = probe ? 1 : filedata->file_header.e_shnum; @@ -8052,9 +8114,24 @@ get_64bit_section_headers (Filedata * filedata, bool probe) return false; } + filedata->orig_section_headers = (Elf_Internal_Shdr **) + cmalloc (num, sizeof (Elf_Internal_Shdr *)); + if (filedata->orig_section_headers == NULL) + { + if (!probe) + error (_("Out of memory reading %u section headers\n"), num); + free (shdrs); + free (filedata->section_headers); + filedata->section_headers = NULL; + return false; + } + memset (filedata->orig_section_headers, 0, + num * sizeof (Elf_Internal_Shdr *)); + + orig_internal = filedata->orig_section_headers; for (i = 0, internal = filedata->section_headers; i < num; - i++, internal++) + i++, internal++, orig_internal++) { internal->sh_name = BYTE_GET (shdrs[i].sh_name); internal->sh_type = BYTE_GET (shdrs[i].sh_type); @@ -8066,7 +8143,8 @@ get_64bit_section_headers (Filedata * filedata, bool probe) internal->sh_info = BYTE_GET (shdrs[i].sh_info); internal->sh_offset = BYTE_GET (shdrs[i].sh_offset); internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign); - validate_section_info (internal, i, filedata, false, probe); + validate_section_info (internal, orig_internal, i, filedata, + false, probe); } free (shdrs); @@ -9016,10 +9094,18 @@ process_section_headers (Filedata * filedata) if (do_section_details) printf (_(" Flags\n")); - for (i = 0, section = filedata->section_headers; + Elf_Internal_Shdr **orig_section = filedata->orig_section_headers; + Elf_Internal_Shdr *sec; + for (i = 0, sec = filedata->section_headers; i < filedata->file_header.e_shnum; - i++, section++) + i++, sec++, orig_section++) { + /* Dump the original section header values if they exist. */ + if (*orig_section) + section = *orig_section; + else + section = sec; + /* Run some sanity checks on the section header. */ /* Check the sh_link field. */ @@ -10197,16 +10283,18 @@ process_relocs (Filedata * filedata) uint64_t num_reloc; uint64_t *relrs = NULL; Elf_Internal_Shdr section = {}; + Elf_Internal_Shdr *orig_section = NULL; section.sh_offset = filedata->dynamic_info[DT_RELR]; section.sh_size = rel_size; section.sh_entsize = rel_entsz; section.sh_type = SHT_RELR; - validate_section_info (§ion, DT_RELR, filedata, - true, false); + validate_section_info (§ion, &orig_section, DT_RELR, + filedata, true, false); num_reloc = count_relr_relocations (filedata, §ion, &relrs); + free (orig_section); free (relrs); if (num_reloc == 0) continue; @@ -24847,6 +24935,12 @@ free_filedata (Filedata *filedata) free (filedata->program_interpreter); free (filedata->program_headers); free (filedata->section_headers); + if (filedata->orig_section_headers) + { + for (unsigned int i = 0; i < filedata->file_header.e_shnum; i++) + free (filedata->orig_section_headers[i]); + free (filedata->orig_section_headers); + } free (filedata->string_table); free (filedata->dump.dump_sects); free (filedata->dynamic_strings); diff --git a/binutils/testsuite/binutils-all/corrupt-1.elf.bz2 b/binutils/testsuite/binutils-all/corrupt-1.elf.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..e9c9f44343a4aadd90457df5e49923830881d194 GIT binary patch literal 81 zcmV-X0IvT+T4*^jL0KkKS`e0 nlM^7w$`z$$Gahz REL 0000000000000000 000000 6666666666666600 00 0 0 0 +#pass diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp index 0f3d75090b2..6c5e63fb9e8 100644 --- a/binutils/testsuite/binutils-all/readelf.exp +++ b/binutils/testsuite/binutils-all/readelf.exp @@ -612,6 +612,18 @@ if ![is_remote host] { } else { readelf_test {-wi} $tempfile pr26160.r } + + set test $srcdir/$subdir/corrupt-1.elf.bz2 + # We need to strip the ".bz2", but can leave the dirname. + set t $subdir/[file tail $test] + set testname [file rootname $t] + verbose $testname + set tempfile tmpdir/corrupt-1.elf + if {[catch "system \"bzip2 -dc $test > $tempfile\""] != 0} { + untested "bzip2 -dc ($testname)" + } else { + readelf_test {-SW} $tempfile corrupt-1.r + } } # Check dwarf-5 support for DW_OP_addrx. -- 2.55.0