From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 4934638582A5 for ; Thu, 1 Feb 2024 12:53:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4934638582A5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4934638582A5 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706792010; cv=none; b=Vpg+cYU+yi9RTbHEJ3UTTPmCQJPEzupvWPPp8waWpXuZvME69nZnmtMHpIXwn+MnCf5V/GC0IlXRcXQyKpHeRnz0WYTVkoKjXNNuiHrSRp2a3zH4iQ+ShC/m6w0SMwNjoRw/mqHJ2yf2KL5AJOKBtUA3q8c9u7RYrKgKcxVFRHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706792010; c=relaxed/simple; bh=ksRvt+JkJg6oifNS8Z9Luo2EV1wVJEvkECODxpDtcpM=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=PVT+Y1bUF3Yf31oVOnpMjm3iWfWCVrTFBy12i7acId+DRY57Hi6wFfbiMadW5czaEOEi2JiXwf1dYEYi4O2KE8aoUaWkGop2AbBqIfqCTzliFo95n4hfZVuvxbmS3zrSgV/UORns51VQ7c3IlNoFMfE1oOSKxzWlZGvIU3f53zU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by smtp-out2.suse.de (Postfix) with ESMTP id 1A1DF1FB83; Thu, 1 Feb 2024 12:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706792001; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m5O2dPbIzCk/whtweCj2reowXeT9CSdiLbFB3vsnFg4=; b=UFJYEWfO1aa8GeSHOptF+g7Du0KSlkkiJ+SOpO8/gVvxU/Me6gwx0vI3FMUdAcH1migcO3 hb2aKBrYySWum6G7yoiIlK5V/UyuiHfDAwUh6di6IyrawaQVmNg2OdDQE7JLigwRN9uPmU JvGLpoMmSVjrEScu1hMZR1uhSDSbKHg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706792001; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m5O2dPbIzCk/whtweCj2reowXeT9CSdiLbFB3vsnFg4=; b=M9nxdfkYePiogXjjtJAXfcyqRwbeXchidLn7Ik8G2QTEJIeuU9x1h0C1TGgqejwN68YbWj Fk3uIjXpB2UjtcDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706792001; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m5O2dPbIzCk/whtweCj2reowXeT9CSdiLbFB3vsnFg4=; b=UFJYEWfO1aa8GeSHOptF+g7Du0KSlkkiJ+SOpO8/gVvxU/Me6gwx0vI3FMUdAcH1migcO3 hb2aKBrYySWum6G7yoiIlK5V/UyuiHfDAwUh6di6IyrawaQVmNg2OdDQE7JLigwRN9uPmU JvGLpoMmSVjrEScu1hMZR1uhSDSbKHg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706792001; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m5O2dPbIzCk/whtweCj2reowXeT9CSdiLbFB3vsnFg4=; b=M9nxdfkYePiogXjjtJAXfcyqRwbeXchidLn7Ik8G2QTEJIeuU9x1h0C1TGgqejwN68YbWj Fk3uIjXpB2UjtcDQ== Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id F40C94A04E5; Thu, 1 Feb 2024 13:53:20 +0100 (CET) From: Andreas Schwab To: "Wang, Yanzhang" Cc: "libc-alpha@sourceware.org" , "adhemerval.zanella@linaro.org" Subject: Re: [PATCH v3] RISC-V: Enable static-pie. In-Reply-To: (Yanzhang Wang's message of "Thu, 1 Feb 2024 12:39:58 +0000") References: <20230810233348.1214955-1-yanzhang.wang@intel.com> <20240102105415.516313-1-yanzhang.wang@intel.com> X-Yow: Is it FUN to be a MIDGET? Date: Thu, 01 Feb 2024 13:53:20 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -2.05 X-Spamd-Result: default: False [-2.05 / 50.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; BAYES_HAM(-0.75)[84.12%] X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On Feb 01 2024, Wang, Yanzhang wrote: > The code in the if will try to lookup the __global_pointer$ and move to the > gp register. It will be failed because l->l_scope is NULL when static-pie. No, l->l_scope is an unrelocated pointer. Since ld.mold puts the addend also in the relocated field, it is read as a nonzero, but invalid pointer. See the static-pie tests in the mold testsuite. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."