From patchwork Mon Mar 27 11:24:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 75347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1432210vqo; Mon, 27 Mar 2023 04:24:13 -0700 (PDT) X-Google-Smtp-Source: AKy350af8iuhiI+jpo97M/RhI+1Skn8VMRCMh0F+5Gv5+kJcpQO81lE5lCmrUP5GzX0hizCSps9i X-Received: by 2002:a17:907:97c9:b0:933:80c:67d7 with SMTP id js9-20020a17090797c900b00933080c67d7mr14086574ejc.49.1679916253606; Mon, 27 Mar 2023 04:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679916253; cv=none; d=google.com; s=arc-20160816; b=IDh7mNylTDeQSmoHLocjeUAtUu7JfTIJoli0vN64J511DHnX1tLNMGtHdYYXvz8sS4 eYyvQMpeiGqssxiICaI+CILzh6gijlFwn2jU18YKAmdgNYbY5qVDOHoiE0oL2RLh0iCb Mua2V1f0bDRF9kTryrfMl9zefh91lyQ3CSeo5H9B0QDyWj+z8IAnMUfna7WSUICGzVWK fQL383Nr5PkJBFWfXCiVgsKUWxet8vq386UWLP6Lg1yq5wgpsVxqw0thCpUemxIhmHrr eJcrwZLAvrXIERepVBV1f4M5/vNRQ30dIubko8PD84jLh5u9j8UiZhg5rRZPunyC8ndu 7Q5A== 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=KvaxaoPFDHeuU0y1HTyp5PwQDM0fYVQ/Q6zL4pgn4OA=; b=SZx82ITK56/MkurIy7iKM+JnKw9A/xSNrT0+UC0Q/9LU0jy8EwSrQB8O5MO73z3y1F ek+YZmQpT7RFBG2a7kbVcJaQOhvyMhnKy/OwCRLtRr9gSVPcmmOQ68AtBr4gOggOgtn3 xQEhywd0FmZYO1HyKvnLnkh+XHLJnr7hnCb4xaL9OVkHFpSY7URW02hnDHSu0ddqbEjZ cOG87QFyOjrGtVTN99xuZlFyLboTf1fCv5qdn9b7L6wQ4ope1HbnFg0EL6tUcsgimor9 lpoe4T9dAfgEwfMzXvO35Lq8WGN25INC2I00ZrMKQNx+C9zY28UlnMWrqF2HVx1Hk+K/ VoRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="K/JHRcvj"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s24-20020aa7cb18000000b004fe5ea74b93si27194842edt.349.2023.03.27.04.24.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 04:24:13 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="K/JHRcvj"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 45D903858CDA for ; Mon, 27 Mar 2023 11:24:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45D903858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679916252; bh=KvaxaoPFDHeuU0y1HTyp5PwQDM0fYVQ/Q6zL4pgn4OA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=K/JHRcvjPBy6rgEmmYD+HSkBzg7OMqpjAK3X607khQqwjl1qDZKPDDdWNjoHZy4yH gz1LfstxAGe04vtKxuSYtmHzBvCzB/O22zevh/BmunUny2PnTbyyKV/ElpNdFai5ib 7jJ/ilf62Orx28fiwx6WDZd9yqd1PA7Se0r5r+10= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id A399E3858D39 for ; Mon, 27 Mar 2023 11:24:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A399E3858D39 Received: by mail-pf1-x434.google.com with SMTP id z11so5418068pfh.4 for ; Mon, 27 Mar 2023 04:24:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679916243; 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=KvaxaoPFDHeuU0y1HTyp5PwQDM0fYVQ/Q6zL4pgn4OA=; b=qXfXhXE/QFx/vPMcb1KC/ndF+j+LHGnt5yoYSMEiTJ3K3Cw/ib2F3frT8Ngfp3krGb dY3u2ph80yvCE+teGTpMGCTBiwbOyvmOoATaNhmcjbIzF25kL08VEuZwfq1GT8FEhZQx j9RQzAbVx7dCnJsHbaMhSV4+tPS1PzUFfo1sI1FpKi7qrNx4HNLbMAyUmVIeo2X0OLDF 52zjDPoJTufNF0h/UrAKvN9MtO71X3UAeumeZBGKhFtqb6265xgslX5YUl912HNgC2JE 0iq67rOCkXYWfXrWzEPoyaDC+0l6mEl6v+Wj7lApCJUziMxoWnYD6mZjG6xoaD1p9Pby ynAQ== X-Gm-Message-State: AAQBX9fFwfxW1X4+7nIr5XU7rAU792S9TQNnzPxGpJjDw6tjYvRMm3wt SFuo+kanpl1nMdsZw5EOev+UjUpRgb4= X-Received: by 2002:aa7:956d:0:b0:627:8e40:68e0 with SMTP id x13-20020aa7956d000000b006278e4068e0mr11174367pfq.15.1679916243520; Mon, 27 Mar 2023 04:24:03 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:1b0:13cb:4f4d:735]) by smtp.gmail.com with ESMTPSA id e9-20020aa78249000000b0058b927b9653sm19386257pfn.92.2023.03.27.04.24.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 04:24:03 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 151761142666; Mon, 27 Mar 2023 21:54:01 +1030 (ACDT) Date: Mon, 27 Mar 2023 21:54:01 +1030 To: binutils@sourceware.org Subject: XCOFF sanity check Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3033.9 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 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?1761519865252097100?= X-GMAIL-MSGID: =?utf-8?q?1761519865252097100?= * coffcode.h (coff_pointerize_aux_hook): Sanity check x_csect.x_scnlen against raw_syment_count. diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 7a4c409a756..bf55d83530d 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -2462,7 +2462,8 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED, && indaux + 1 == symbol->u.syment.n_numaux) { BFD_ASSERT (! aux->is_sym); - if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) == XTY_LD) + if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) == XTY_LD + && (bfd_vma) aux->u.auxent.x_csect.x_scnlen.l < obj_raw_syment_count (abfd)) { aux->u.auxent.x_csect.x_scnlen.p = table_base + aux->u.auxent.x_csect.x_scnlen.l;