From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 79E4E3938399 for ; Mon, 18 Jan 2021 00:41:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 79E4E3938399 Received: by mail-oi1-x232.google.com with SMTP id w124so16106944oia.6 for ; Sun, 17 Jan 2021 16:41:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CqmRXJPMFWalkdelo7cD5KI37sPxX7Prd+GDt0wDWFI=; b=RtmutPjN08Na4Fr3HBmQMPLHmfVqAAlF6hht1pPl8KdO/T9BxnacDCty+9+PZemal9 ubTNjo2Gv+oaKvaydaqodo86ja6aDXgysZTwtmz3K2Z/T3B+1v3WGPhKO7Df0sXFqQQP Dtkl+uAv0/lEoFurLjM/Zq9M2J4pXG2XnCaH9X1lyIpi5LsLISqER4WHiIfX/tosH77+ xuYmz0Xtrx7jusxaNSt7eW8eDcrPWabdPK8Db6VBwFJtvBhYPdIJsGgjlnXtyUHnuOij gw4WmehHyr/9c5SrfDeMdVn4aHINBwG+2L+VlAQcBexJoR4SWj0WWHN6i7nNxK85Q9RY x86A== X-Gm-Message-State: AOAM532aX5NCJPMheyPAT36iZbezM8yhdYFNfrMaX15W+lCIt8saY41z u0byriZW4XpvV1EKc4/8FWL/lFg/ceMOXxwjoCs= X-Google-Smtp-Source: ABdhPJzRtWMF8OLKNisJLAC5nxSzs5S27HVhNpVp1YD5YgRrnTqBbp2YKnQdGNdLMkuIzFXwmlNwBDrd6dagZFpT4XA= X-Received: by 2002:aca:4d8b:: with SMTP id a133mr12054226oib.79.1610930494889; Sun, 17 Jan 2021 16:41:34 -0800 (PST) MIME-Version: 1.0 References: <20210118002817.GR26219@bubble.grove.modra.org> In-Reply-To: <20210118002817.GR26219@bubble.grove.modra.org> From: "H.J. Lu" Date: Sun, 17 Jan 2021 16:40:58 -0800 Message-ID: Subject: Re: x To: Alan Modra Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3036.2 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Mon, 18 Jan 2021 00:41:36 -0000 On Sun, Jan 17, 2021 at 4:28 PM Alan Modra wrote: > > From 047fc1a199fd859df6f662f7ce47cf1e7bdf4e4d Mon Sep 17 00:00:00 2001 > From: Alan Modra > Date: Mon, 18 Jan 2021 09:38:22 +1030 > Subject: PR27198, segv in S_IS_WEAK > > This erroneous input > call (%rax)printf > results in a NULL dereference. > > A nicer fix might be to parse "call (%rax)junk" as "call (%rax)" which > is a variant of "call *%rax" missing the explicit indirection and with > some extra parentheses, but I figure it's not worth bothering. > > OK? > > PR 27198 > * config/tc-i386.c (need_plt32_p): Return FALSE for NULL symbol. > > diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c > index a7d2ff1c1f9..b0140e1128a 100644 > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -8628,6 +8628,9 @@ need_plt32_p (symbolS *s) > if (!object_64bit) > return FALSE; > > + if (s == NULL) > + return FALSE; > + > /* Weak or undefined symbol need PLT32 relocation. */ > if (S_IS_WEAK (s) || !S_IS_DEFINED (s)) > return TRUE; > OK with a testcase to show that the assembler issues an error message. Thanks. -- H.J.