From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mr6.vodafonemail.de (mr6.vodafonemail.de [145.253.228.166]) by sourceware.org (Postfix) with ESMTPS id 9533A3858436 for ; Tue, 15 Feb 2022 20:19:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9533A3858436 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nexgo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nexgo.de Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4Jysr74GR1z24kT for ; Tue, 15 Feb 2022 20:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexgo.de; s=vfde-smtpout-mb-15sep; t=1644956359; bh=+AfPpc6UXXxS+0nsIY1tz4aU3cPjzuhkF/fCfJPYj0I=; h=From:To:Subject:In-Reply-To:References:User-Agent:Date:Message-ID: Content-Type:From; b=oV4w60qiw9Hj+1IXOCBQ6gVoO2P2N8kD7LS77zBx90p4bADXtfttJ4gx2MuikJVNv +ragV6g7cNSvpb3sDUXLi2SDOuRM9KkKE7TacppPKJzQ79eGe1EObLhfS3dAaU7ydV 8KnZMP4h0p3RSVeWWJT4dbYVLTJNDJo1Txsh2x+4= Received: from Gertrud (p5b2f3a9b.dip0.t-ipconnect.de [91.47.58.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4Jysr65MNJz9s4Z for ; Tue, 15 Feb 2022 20:19:15 +0000 (UTC) From: Achim Gratz To: binutils@sourceware.org Subject: Re: [Bug] DWARF-5 section names in PE/PEP and weak symbols In-Reply-To: <87bkz8hv09.fsf@Rainer.invalid> (Achim Gratz's message of "Tue, 15 Feb 2022 18:58:30 +0100") References: <878rwvrlz9.fsf@Rainer.invalid> <87mtiumsgt.fsf@Rainer.invalid> <87y22d7lss.fsf@Otto.invalid> <87bkz8hv09.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Date: Tue, 15 Feb 2022 21:19:08 +0100 Message-ID: <87y22bhohv.fsf@Rainer.invalid> MIME-Version: 1.0 Content-Type: text/plain X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1317 X-purgate-ID: 155817::1644956358-000004C7-2DD00F73/0/0 X-Spam-Status: No, score=-3030.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Tue, 15 Feb 2022 20:19:23 -0000 Achim Gratz writes: > So, snprintf seems to behave as expected (it resolves NULL) and the two > other symbols are resolved even though they should not. If they had > resolved to the actual address things might even work, but the actual > values explain nicely why a program calling through the pointer crashes > in various horrible ways (depending on what actually is mapped there). I've verified that when I add potential call sites and not just printf output to the other two functions, they no longer get resolved at link time and show up as NULL in the resulting executable. That part is quite likely as intended. However, if the linker doesn't see a call site it resolves something that apparently doesn't work later on. I have not yet tracked down how the grep-3.7 binary ends up crashing, but the most likely path is that theweak symbol gets resolved to something nonsensical during an intermediate link step and then transferred into the actual executable that doesn't resolve the symbol at all (using some data in the object instead of the library) or not relocating correctly. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada