From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 31F1B3858D39 for ; Thu, 6 Jan 2022 08:35:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 31F1B3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5F78E1F37F; Thu, 6 Jan 2022 08:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1641458125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LFzaqia/o33g7AtbsTV59+Gao/yWSDeQyercSNXefdo=; b=paukjkom2qssGfH3Lt7Kbts/DfsRNeAngqWutnjv61Da7GaBiguMs6Z9XOivL9FhANe2E6 gW3DdN7MyKz1AgvYLDItKVjBFFWYD/hp2onrSX7xczTGFwhfjEMp0OIb+hkewrJVYY6YZx rRcaZ1ia+U6iPCAtfpJ5TKWDaDdUhcI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1641458125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LFzaqia/o33g7AtbsTV59+Gao/yWSDeQyercSNXefdo=; b=Q0TW0lv4ybJzPwS2/ifLZRMCvvVDnQY+is+uAl8rgSKzPjVPDGgexg2QPQK8UlXIPJFjJ6 0/pui72yxcVmbOCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3835E13BE4; Thu, 6 Jan 2022 08:35:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5B1DDM2p1mGSVAAAMHmgww (envelope-from ); Thu, 06 Jan 2022 08:35:25 +0000 Message-ID: <3c9eb1e3-6dd0-8e51-312f-beedecd5facc@suse.cz> Date: Thu, 6 Jan 2022 09:35:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] gold: fix crash for empty file Content-Language: en-US To: Cary Coutant Cc: Binutils , Ian Lance Taylor References: <68116639-4565-14f5-ce21-6427487b24c1@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 06 Jan 2022 08:35:28 -0000 On 1/5/22 18:35, Cary Coutant wrote: >>>> @@ -701,6 +701,8 @@ Symbol_table::resolve_forwards(const Symbol* from) const >>>> Symbol* >>>> Symbol_table::lookup(const char* name, const char* version) const >>>> { >>>> + if (name == NULL) >>>> + return NULL; > > I'm more concerned with why a NULL name got passed to lookup in the > first place. In this test case, it's because parameters->entry() is > returning NULL, which in turn is because no (valid) object files have > been named, so a target hasn't been determined. I'd be more > comfortable with maintaining the requirement of passing a non-null > name to Symbol_table::lookup() (perhaps even adding an assert to that > effect), and then fixing Plugin_hook::run() to check for NULL before > calling lookup. Sure, I must confess I don't know gold enough. Thus, leaving that to you. Cheers, Martin > > -cary