Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3374752pxb; Mon, 4 Apr 2022 15:03:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwqL7vXy3zD/uBMcJdT1NeqNuUKCyTFbWTXC7uof9WKlNtO68scCgMQOVT9Ac5uSoetwUr X-Received: by 2002:a1f:94c9:0:b0:331:141d:13b0 with SMTP id w192-20020a1f94c9000000b00331141d13b0mr206792vkd.18.1649109776986; Mon, 04 Apr 2022 15:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649109776; cv=none; d=google.com; s=arc-20160816; b=FAE0G2sL8w/Z2YiE8a7py5YeOdT1x5CEHbmt8Rgt49LHT0maS2+qZ8nsFbRiNHODai ae0soRiDIl3ax/rg4M5CnBxK6gDrVgoLAMINSN8VYTSuvCScLLhX6PC48wxD8Cf+maz/ AW/NmN0CrR+FTXWv/t9soKH+O+8f0V/a5I38h+tVNf6vFv/ss2RzxCk8cbvmAG2r3xhs 5bLCUTZ4j79LRRzHpLqBqmkdHAcHxCHk+04wew5oVHjz3NTtKcYjvW9ytX4OSfU9PJ2l hLH8YkRNcinKINVIMchMAu/oUwSUB0sAHXIvddK8xr63fl6umtytQZylKzEPoOdUKGkt YunA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=6Z5Iwpu9An5vyH96KMcPgO159dciFvzkbVjfqmaAuOs=; b=oUS424se05yD5Rw7vqqOEpyj0aC7P0pfss3k8hF6ojz3e/cUkPaHZvPrvF/7R0KGDt /N0MjAay4b0i0OIh2aQrrR8g7UmJP9Tz1T57MtYAfEkEF/LVUy+j0M0EewAIk7WblH0+ c2r6DQ6pwtcCZpJ0UT8+sbnavgwWjzWhQox/mIVLiH/n/ptYClIiuE7R7KQhtc9oXgl2 aXr7giM8F1Irzmz4Ke5jDm9hQEaIRTguR3XYuc6qqS6yMAx6UVpgqjqTxAzUwxhHJw6W FBbH45c3u6w/7WhrmFYVMkRYTYZCrXoAa4eA3OgmAbaDwOKWucgzPBQrW3PVh1nJVE8T Nsag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020ab05ad8000000b00355f1db7affsi968015uae.135.2022.04.04.15.02.41; Mon, 04 Apr 2022 15:02:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238704AbiDBWQj (ORCPT + 99 others); Sat, 2 Apr 2022 18:16:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiDBWQi (ORCPT ); Sat, 2 Apr 2022 18:16:38 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C42F3E5C2 for ; Sat, 2 Apr 2022 15:14:45 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id D531792009C; Sun, 3 Apr 2022 00:14:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id CEAFF92009B; Sat, 2 Apr 2022 23:14:43 +0100 (BST) Date: Sat, 2 Apr 2022 23:14:43 +0100 (BST) From: "Maciej W. Rozycki" To: James Jones cc: Kees Cook , bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: Remove a.out support In-Reply-To: Message-ID: References: <4c449fab-8135-5057-7d2c-7b948ce130cc@theinnocuous.com> <0b31b1d3-852d-6cab-82ae-5eecaec05679@theinnocuous.com> <202203151150.1CDB1D8DA@keescook> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Mar 2022, James Jones wrote: > Probably getting a bit off topic, but I did spend a few hours searching > around for any existing tools to convert a binary from a.out->ELF, and > trying to come up with something myself by extracting the sections with > objdump and re-combining them into an ELF using a linker script placing > the sections at the same locations. I couldn't get it working in an > evening or two messing with it so I moved on, but I agree something like > this seems possible in theory. Chiming in late as I'm scanning outstanding mailing list traffic: if this is as you say all statically linked stuff, then converting from a.out to ELF might be as easy as: $ objcopy -I a.out-i386-linux -O elf32-i386 a.out-binary elf-binary though you may have to build yourself suitably old i386-linux-gnu binutils (from ftp.gnu.org), e.g. this version does support a.out: $ objcopy --info BFD header file version 2.15.91 20040527 elf32-i386 (header little endian, data little endian) i386 a.out-i386-linux (header little endian, data little endian) i386 efi-app-ia32 (header little endian, data little endian) i386 elf32-little (header little endian, data little endian) i386 elf32-big (header big endian, data big endian) i386 srec (header endianness unknown, data endianness unknown) i386 symbolsrec (header endianness unknown, data endianness unknown) i386 tekhex (header endianness unknown, data endianness unknown) i386 binary (header endianness unknown, data endianness unknown) i386 ihex (header endianness unknown, data endianness unknown) i386 trad-core (header endianness unknown, data endianness unknown) elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big i386 elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big srec symbolsrec tekhex binary ihex trad-core i386 srec symbolsrec tekhex binary ihex --------- The last binutils version to support a.out-i386-linux was 2.30 I believe. Just configuring for i386-linux-gnu should do as a.out used to be included as a secondary BFD target (you can also do `--enable-targets=all' to get support for all kinds of the exotic and less exotic BFD targets). HTH, Maciej