From patchwork Tue May 30 04:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 100530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1926449vqr; Mon, 29 May 2023 21:24:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CtFEci++oWgY9pngtgwablOsjzQFLAFvGB5w8GjupA7exeTIwBYposlnc7VrBnuYU2fRd X-Received: by 2002:a17:907:1626:b0:969:e993:6ff0 with SMTP id hb38-20020a170907162600b00969e9936ff0mr9301397ejc.25.1685420677463; Mon, 29 May 2023 21:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685420677; cv=none; d=google.com; s=arc-20160816; b=q11k3G3jn001CqVTFGnqGFvNYTY2+6lBUn6TTXelcJP8BrpRyNalabq+MBcue2UqQl sOp78xKwdayhHoN0hT1Pf6pkQMQOOl0Ut+eLNvPFaay8izasGPAOLmyzkoUmyl0m3KI1 TYEF2MIDCQG/kcGFRP8WqAuQDKOg22S4Vt/qWF1rSqsECFOxK+0owI4UjHY4n3Cgrny6 j1P4+YUQ3SqYkI+LI2XHK/kOiIcZ0elB1Bu1rbkOL0mA4PPdRUFBxxxxu4+0EAf6NuQp ikXSr1pus1DLquAbfh3n5xLBtPWVCP6qiHAClvFsor53yHVa40wRPXg0Ka6pWL2jh58M p+HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ilqZtij7MXZ8xyzssMlXHFnx6Oh9lqrTTha0n92nBxI=; b=yHbHQWpU1KwAin5y2m6pAgnKBKhym2gR1VO314D07sLno0ivHHF5bhY5lWMseFDTNA e1HZzpsNqmfpR+UdWT43+jHbAG2t0QahefUFo7iYZoG+NJJgr9Yn9o99z3LdA1nq9MGV vGGjySy5iFyvq0yZ8g4I9oEdn2laNsV+i1s9skZdm/kmABxGq/kjtZbsygIzgJeTFmcR koNB5OTS/8/Psx8uxBacgxaVNtQ2+TVO88nVFfscQuzXK/b12rr/DNDgQVvWJUlCrwU9 hpKLMvs6Kk/sy16z4mQFiwIV3Cgk8WXvGd6etfAjynDCD1m10q7xSLvkJIgZJxnixykI AejA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=goGVETQy; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dy23-20020a05640231f700b0050dacef3bc4si5374865edb.297.2023.05.29.21.24.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 21:24:37 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=goGVETQy; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F3313853837 for ; Tue, 30 May 2023 04:24:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F3313853837 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685420645; bh=ilqZtij7MXZ8xyzssMlXHFnx6Oh9lqrTTha0n92nBxI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=goGVETQy/1DcZPULv9uKRuZgu6ljMetIpyK5BWkyD0sX0c7bcjn5/1h03wNCUh9gV lmbyi3ATDI/yJmWw7GPG9xvYmTV+8mKiN2jxU/cFze6IGGMiWfTKQujNETPr0l/7us ftUKBqWexOTdpc3ykFIVysMBhTaUULTtRNGgCtzk= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 735743854E59 for ; Tue, 30 May 2023 04:23:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 735743854E59 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1b02fcde49aso14519235ad.0 for ; Mon, 29 May 2023 21:23:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685420637; x=1688012637; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ilqZtij7MXZ8xyzssMlXHFnx6Oh9lqrTTha0n92nBxI=; b=B4CNJyRSWjxNk3GXmCXohHaya9GzULbn3VEaW5fs3n6mlyFMq/fZcRqjfiHJE68YO4 Wp+CiURi2+uDL8Z1d7tUHi40GJhF+dpltCEjpXD1wmVTKvEIQEIe1PyhpX1HuVNwQeJi N2FzoiP2QPtTSiV8dUMl48Z5u8f0xpwj0dElWPmuKGPsOilHGMljqkrURElP+tDHgJ6V twKNyt4K8agDpIuIHNdkCDu/wsOpXdYoAmvwWWhzv+oPqSfRZPjwgTqT/U+Yd3ZO+pS7 Xk/aIuZYfg0/TWJoKqmRTcFTX/K0f1zmHgWc4pWTXmDGSskxrBh3ukNiKv/kbJHLzcbJ Q0JA== X-Gm-Message-State: AC+VfDywmjjJqrPI65QvBN6CPt+kNa6YOAhQ5Sja6hziVevKMxeJ1k07 5ojST0gSEi+wt89DIKV1yDuvH51aMqU= X-Received: by 2002:a17:902:e547:b0:1b0:46af:7f15 with SMTP id n7-20020a170902e54700b001b046af7f15mr1370973plf.64.1685420637116; Mon, 29 May 2023 21:23:57 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id h7-20020a170902680700b001a6dc4f4a8csm3417517plk.73.2023.05.29.21.23.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 21:23:56 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 952F51142C22; Tue, 30 May 2023 13:53:54 +0930 (ACST) Date: Tue, 30 May 2023 13:53:54 +0930 To: binutils@sourceware.org Subject: arm-pe objdump -P Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3034.7 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, 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 server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767291672443713008?= X-GMAIL-MSGID: =?utf-8?q?1767291672443713008?= arm-pe looks to be a very old PE implementation, incompatible with current arm-wince-pe. arm-pe has different relocations and uses ARMMAGIC which has this comment: "I just made this up". Well, OK, I don't know the history but it was probably before Microsoft "just made up" their constants for ARM windows CE. This patch supports objdump -P for arm-pe, and another magic constant that may appear in object files. (I don't think binutils generates files using ARMV7PEMAGIC aka IMAGE_FILE_MACHINE_ARMNT.) * od-pe.c (is_pe_object_magic): Handle IMAGE_FILE_MACHINE_ARMNT and ARMMAGIC. diff --git a/binutils/od-pe.c b/binutils/od-pe.c index 5f03bd8c3da..5a57a6e7486 100644 --- a/binutils/od-pe.c +++ b/binutils/od-pe.c @@ -450,6 +450,7 @@ is_pe_object_magic (unsigned short magic) case IMAGE_FILE_MACHINE_ALPHA: case IMAGE_FILE_MACHINE_ARM: case IMAGE_FILE_MACHINE_ARM64: + case IMAGE_FILE_MACHINE_ARMNT: case IMAGE_FILE_MACHINE_I386: case IMAGE_FILE_MACHINE_IA64: case IMAGE_FILE_MACHINE_POWERPC: @@ -457,6 +458,7 @@ is_pe_object_magic (unsigned short magic) case IMAGE_FILE_MACHINE_AMD64: // FIXME: Add more machine numbers. return true; + case 0x0a00: /* ARMMAGIC */ case 0x0500: /* SH_ARCH_MAGIC_BIG */ case 0x0550: /* SH_ARCH_MAGIC_LITTLE */ case 0x0b00: /* MCore */