From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 39F883858D20 for ; Sun, 7 Apr 2024 17:34:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39F883858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 39F883858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712511294; cv=none; b=tg4Fzrj1gqn4VHIr0//phZiGac+vDNiptwJgQ/hetq2v9yN1QkQXTjaliam6KOZjcL06yJ7eFU3XvR01FZ+yCIsui8EC9MN5bTPwOe8DRY7pGthBYzvna4eZER5nXE5CIPZ7NReogHbNws7CHGVlNGY+XhLiIZ4WVkGKFv85YUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712511294; c=relaxed/simple; bh=HhZuNyYoa8xi6DX7vsJ1wlLvMkCAckzCpSz1Di7dgMo=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=aA5fPhqUakmZ9iUA9rL4vMGVVdawE2Bo7GlLZnnkqAbWzhs5HSaVu1B8HBnspSRiEzDdLTyaewjRHxEhQWh6yIVxMqat7opvfwQ3kC0DmaCYM4MJU/yWDIPOdx1AgPHgND/ouMcUM69n6uzB/RQhb0PDNwRzadn7sO/McEJrEwA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1712511290; bh=HhZuNyYoa8xi6DX7vsJ1wlLvMkCAckzCpSz1Di7dgMo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=hfAMGPq8S6/fUyT8+V9B/18n0QF1/TO/14qEMzY3MfsY7IBSAcRz9XMV30MrfXSRU Wa/NjcQNkUlo0uWZiRYEko3mGBwGN/bX8Ss3h6bXTKLcoO943XrY6F+NBZUGyteXzG gTOnwhQHatpQ/R+bQFO3zJDg3pTD4WffD/Gb3KDs= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id A723766A1A; Sun, 7 Apr 2024 13:34:48 -0400 (EDT) Message-ID: <85592d99e8dc976ce10c62a91b8db8e91350c46c.camel@xry111.site> Subject: Re: [PATCH v1] LoongArch: ld: Move .got .got.plt before .data and protect .got with relro From: Xi Ruoyao To: mengqinggang , binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, cailulu@loongson.cn, i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn, hejinyang@loongson.cn Date: Mon, 08 Apr 2024 01:34:46 +0800 In-Reply-To: <20240403063144.2812402-1-mengqinggang@loongson.cn> References: <20240403063144.2812402-1-mengqinggang@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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 Wed, 2024-04-03 at 14:31 +0800, mengqinggang wrote: > +++ b/ld/testsuite/ld-loongarch-elf/data-got.d > @@ -0,0 +1,16 @@ > +# line 11 test the first two entries of .got.plt in relro region > +# relro segment size is .dynamic size + .got size + 0x10 > +# line 13 test .got .got.plt before .got > +# line 15 test .got in relro segment > +#as: > +#ld: -shared -z relro Need --hash-style=3Dboth here, or... > +#readelf: -l --wide > +#skip: loongarch32-*-* > + > +#... > +=C2=A0 GNU_RELRO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x003c10 0x0000000000007c= 10 0x0000000000007c10 0x0003f0 0x0003f0 R=C2=A0=C2=A0 0x1 with --enable-default-hash-style=3Dgnu we get a slightly different output: GNU_RELRO 0x003c20 0x0000000000007c20 0x0000000000007c20 0x0003e0 0x= 0003e0 R 0x1 --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University