From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 8D7EC3858C52 for ; Sat, 13 May 2023 11:18:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D7EC3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-52cbd7d0c37so6052088a12.3 for ; Sat, 13 May 2023 04:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683976684; x=1686568684; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=vczQrpJWIiRHoBtq9M8IT1kgqQv/mUs3IA403tTyFF0=; b=ixaEcsQ0Orimd8SRhiwhDpmtFXu6wNsl93sW23dQIDoLn2DxpLd91S//FSjDnxs73W rgkMkb8u3WHdEXl2HcXyN6Gyerqy43GlLpxkT14HH+bv6nRfy/YTdz/Hj9kIvo7W0xxu P6CXasPauGCRi4wjz/M0btIzBt4PyoEt70UxSWBtHDo7XaCnnjH0Vid0zGqHJXt8no2u /iTjc4mfNwJw23gf34vkY7VcSr1dbrjcuvywGeazIVjyrvyjsVoo9fUhEwh411ihvkmp 9L/BSaEvNicGI4+Bll+TeL5hGw3l+CIU4+LDW7QW5/X5PEBjgj99coRRC/3A3LTAl67k /wsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683976684; x=1686568684; 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=vczQrpJWIiRHoBtq9M8IT1kgqQv/mUs3IA403tTyFF0=; b=AtbnYtE6vN8CHiMu7Ml9TmjcyqNuZdVH5sS68K6OV9RTtCFNBEfAH6KD8xy0Si3uod gsV/FSg4nZtHRjlv24ngIrtNNIjMjJrsmpxCh4yLVrx6GLYpOEqylH+5EOc+4PEXgkuP Owes+6yQ8z0gx7dGPtSq/cT8+TlYvDuDbDQnStvCMDRK6Bg1zLHj16Wmg884irzMpdD4 ZRnQ4sJSg+YWTJ4YbvOlSBPIXqHOXPPC9DvxqKOd6r1+L5duNVnvVGMpsjMaqb7yf06f TQAVo8hyG3v5OJIm928zLgfPhmdWGOw4dLo1VO2BocWHfeia6mUdfwXRyyeSkCK4PKRV EA2g== X-Gm-Message-State: AC+VfDzST0cYn5iCoDrpk/9IAXaunIcbqNHJnKnew6t9RRwO+LqU+I+N zKetwSss8txG2SMZ/Dx4PpokXzb9EQA= X-Google-Smtp-Source: ACHHUZ48cHAUjvttKYRKYFtpbbWi4CpkdKgIZUfDE1CHZIsOkKgbtzij6WgyqLG8d/wLPs5wZVTfhQ== X-Received: by 2002:a17:90a:290e:b0:23c:fef0:d441 with SMTP id g14-20020a17090a290e00b0023cfef0d441mr28570730pjd.33.1683976684042; Sat, 13 May 2023 04:18:04 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:314f:3514:134d:47b3]) by smtp.gmail.com with ESMTPSA id t11-20020a17090b018b00b0024de39e8746sm18507568pjs.11.2023.05.13.04.18.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 04:18:03 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 3B2361142F55; Sat, 13 May 2023 20:48:01 +0930 (ACST) Date: Sat, 13 May 2023 20:48:01 +0930 From: Alan Modra To: binutils@sourceware.org Subject: PR28955 mips gas segfault Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3034.3 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 List-Id: I'm going to commit this as obvious enough to not ask for target maintainer approval. Testing for NULL in pic_need_relax fixes the other call to this function in md_estimate_size_before_relax. PR 28955 * config/tc-mips.c (mips_frob_file): Move NULL sym test to.. (pic_need_relax): ..here. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 8a970ceada2..55a116ffd90 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -15449,8 +15449,7 @@ mips_frob_file (void) there isn't supposed to be a matching LO. Ignore %gots against constants; we'll report an error for those later. */ if (got16_reloc_p (l->fixp->fx_r_type) - && !(l->fixp->fx_addsy - && pic_need_relax (l->fixp->fx_addsy))) + && !pic_need_relax (l->fixp->fx_addsy)) continue; /* Check quickly whether the next fixup happens to be a matching %lo. */ @@ -17705,6 +17704,9 @@ pic_need_relax (symbolS *sym) { asection *symsec; + if (!sym) + return false; + /* Handle the case of a symbol equated to another symbol. */ while (symbol_equated_reloc_p (sym)) { -- Alan Modra Australia Development Lab, IBM