From nobody Wed Dec 17 19:23:21 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB4C4C5AD4C for ; Thu, 23 Nov 2023 18:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbjKWSC7 (ORCPT ); Thu, 23 Nov 2023 13:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbjKWSC4 (ORCPT ); Thu, 23 Nov 2023 13:02:56 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF6F810D2 for ; Thu, 23 Nov 2023 10:03:02 -0800 (PST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id A28F94152B for ; Thu, 23 Nov 2023 18:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1700762581; bh=IZhERP1k0Mx/BUzQA+h6IX0Zi/l8fXxzweZfh/vGwZ8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bm0dFaWF0mhS5DLbODavbNYMvM69+E+3vjvIBl2Iba1Xzq28JNt72GpC1UqaE97t/ L/m8pg7pxbKA8V0plM0KjKDswRouZA757qXL6R4kaaw0MxtZsvW1N1+USaLxWBF5qU //OZaIUhbxAb9Wr6S+W7rgaUWsrgBdfKYVW8WIteoJEDqJFXWR5azEAG6dOu/7/IYo 96IclmAWpq2gQEBn2b7K82bXKltxvO/l9U1xSpL47o22yORiufp9KYU+SIDoDs+6ne p4MNgYQLM9oETvtwS4EZBrL1Jj8vpI0LWFKiQNW/bGmrHxC6ONbjvqlrVh32Zty7T+ cG9OXH4S4l5rA== Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40b2977d7c5so5477955e9.2 for ; Thu, 23 Nov 2023 10:03:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700762581; x=1701367381; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IZhERP1k0Mx/BUzQA+h6IX0Zi/l8fXxzweZfh/vGwZ8=; b=VdOVaR8Bym0dQkb+Wh9qalNtxzv+AKnGOGNfZwoOwirNpreyAAlWFsXH/G9ZdG74ON EuMqYbRwksOcWahErqv/M8G2tLFevTrumw1ahkHxWwWwPbIaZhOjY1jNIR5TM2bw05QX zJ7Vpo4vkhnY6jrdMOw6sEbuk/88+vqwuPPyw0pcbTyClRLWhqtncqOQRbkej2VSRZnR 0HVeFfTBU81F/My35+WvuApfSiUt1QgoInVVePCP9iHy9FpD9qIgdfiWa0elfThbr+Xt EvLHtzQ7x6iey5koEJbXF9tsQ3Gk5Z/z3B2qvRMOEG8yvcVvO8Kjjo2RBwtMjor6ZsX/ 2sOg== X-Gm-Message-State: AOJu0YyvD2vUjfSNetPPuexKqBfu9paEkkXUlUiq++/phOGUDXiV4hIO hs6zW3ilFSV94v7zPuXdR2qQpk+UG7dHv717O9CEfE0xEmvq7ItlwroUR+oBxte75ItIjVNPCz1 Ta5si5o1P20E4vu8vXSKxvC365EsanZ3E0yoZFg4b4w== X-Received: by 2002:a05:600c:3b87:b0:401:b2c7:34a8 with SMTP id n7-20020a05600c3b8700b00401b2c734a8mr269710wms.7.1700762581181; Thu, 23 Nov 2023 10:03:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaRuyi+0akFvSjaF5Jn6MGpgnlz1tMo6K/RVM8k2sDbh9gA+jVmH6qtYWR9GxC0Qx5oSTDOQ== X-Received: by 2002:a05:600c:3b87:b0:401:b2c7:34a8 with SMTP id n7-20020a05600c3b8700b00401b2c734a8mr269696wms.7.1700762580759; Thu, 23 Nov 2023 10:03:00 -0800 (PST) Received: from localhost ([2001:67c:1560:8007::aac:c15c]) by smtp.gmail.com with ESMTPSA id v11-20020a05600c444b00b0040b3867a297sm1026777wmn.36.2023.11.23.10.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:02:59 -0800 (PST) From: Dimitri John Ledkov To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Geert Uytterhoeven , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" Cc: linux-alpha@vger.kernel.org, linux-m68k@lists.linux-m68k.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] alpha: remove a.out support from tools/objstrip Date: Thu, 23 Nov 2023 18:02:41 +0000 Message-Id: <20231123180246.750674-2-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123180246.750674-1-dimitri.ledkov@canonical.com> References: <20231123180246.750674-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" As a.out support has been dropped from alpha port, drop a.out support and make ELF support required. Only performed a test build on x86 for native x86 and cross-compiled for alpha. Signed-off-by: Dimitri John Ledkov --- arch/alpha/boot/tools/objstrip.c | 52 ++++---------------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objst= rip.c index 7cf92d172d..91c0ad29e1 100644 --- a/arch/alpha/boot/tools/objstrip.c +++ b/arch/alpha/boot/tools/objstrip.c @@ -21,17 +21,12 @@ =20 #include #include -#include - -#include -#include -#include -#ifdef __ELF__ -# include -# define elfhdr elf64_hdr -# define elf_phdr elf64_phdr -# define elf_check_arch(x) ((x)->e_machine =3D=3D EM_ALPHA) -#endif + +#include +#define elfhdr elf64_hdr +#define elf_phdr elf64_phdr +#define elf_check_arch(x) ((x)->e_machine =3D=3D EM_ALPHA) + =20 /* bootfile size must be multiple of BLOCK_SIZE: */ #define BLOCK_SIZE 512 @@ -55,13 +50,10 @@ main (int argc, char *argv[]) size_t nwritten, tocopy, n, mem_size, fil_size, pad =3D 0; int fd, ofd, i, j, verbose =3D 0, primary =3D 0; char buf[8192], *inname; - struct exec * aout; /* includes file & aout header */ long offset; -#ifdef __ELF__ struct elfhdr *elf; struct elf_phdr *elf_phdr; /* program header */ unsigned long long e_entry; -#endif =20 prog_name =3D argv[0]; =20 @@ -145,7 +137,6 @@ main (int argc, char *argv[]) exit(1); } =20 -#ifdef __ELF__ elf =3D (struct elfhdr *) buf; =20 if (memcmp(&elf->e_ident[EI_MAG0], ELFMAG, SELFMAG) =3D=3D 0) { @@ -192,37 +183,6 @@ main (int argc, char *argv[]) prog_name, (long) elf_phdr->p_vaddr, elf_phdr->p_vaddr + fil_size, offset); } - } else -#endif - { - aout =3D (struct exec *) buf; - - if (!(aout->fh.f_flags & COFF_F_EXEC)) { - fprintf(stderr, "%s: %s is not in executable format\n", - prog_name, inname); - exit(1); - } - - if (aout->fh.f_opthdr !=3D sizeof(aout->ah)) { - fprintf(stderr, "%s: %s has unexpected optional header size\n", - prog_name, inname); - exit(1); - } - - if (N_MAGIC(*aout) !=3D OMAGIC) { - fprintf(stderr, "%s: %s is not an OMAGIC file\n", - prog_name, inname); - exit(1); - } - offset =3D N_TXTOFF(*aout); - fil_size =3D aout->ah.tsize + aout->ah.dsize; - mem_size =3D fil_size + aout->ah.bsize; - - if (verbose) { - fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", - prog_name, aout->ah.text_start, - aout->ah.text_start + fil_size, offset); - } } =20 if (lseek(fd, offset, SEEK_SET) !=3D offset) { --=20 2.34.1