From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 7F80A3857C73 for ; Tue, 15 Feb 2022 14:57:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F80A3857C73 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9FD59210F4; Tue, 15 Feb 2022 14:57:33 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 9AA31A3B81; Tue, 15 Feb 2022 14:57:33 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 9213A6537; Tue, 15 Feb 2022 14:57:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 90C856264; Tue, 15 Feb 2022 14:57:33 +0000 (UTC) Date: Tue, 15 Feb 2022 14:57:33 +0000 (UTC) From: Michael Matz To: "H.J. Lu" cc: Binutils Subject: Re: [PATCH 2/2] x86-64: Use MAXPAGESIZE for the relro segment alignment In-Reply-To: Message-ID: References: <20220215011026.738505-1-hjl.tools@gmail.com> <20220215011026.738505-2-hjl.tools@gmail.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Tue, 15 Feb 2022 14:57:37 -0000 Hello, On Tue, 15 Feb 2022, H.J. Lu wrote: > > > Adjust x86-64 linker tests after reverting > > > > > > commit 31b4d3a16f200bf04db8439a63b72bba7af4e1be > > > Author: Alan Modra > > > Date: Thu Feb 3 08:57:47 2022 +1030 > > > > > > PR28824, relro security issues, x86 keep COMMONPAGESIZE relro > > > > > > to use MAXPAGESIZE for the end of the relro segment alignment, like other > > > ELF targets. > > > > > > --- a/ld/testsuite/ld-x86-64/pr14207.d > > > +++ b/ld/testsuite/ld-x86-64/pr14207.d > > > @@ -11,9 +11,9 @@ There are 4 program headers, starting at offset 64 > > > Program Headers: > > > Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align > > > LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x000150 0x000150 R 0x200000 > > > - LOAD 0x000b.8 0x0000000000200b.8 0x0000000000200b.8 0x0004.0 0x000c.8 RW 0x200000 > > > - DYNAMIC 0x000b.0 0x0000000000200b.0 0x0000000000200b.0 0x0001.0 0x0001.0 RW 0x8 > > > - GNU_RELRO 0x000b.8 0x0000000000200b.8 0x0000000000200b.8 0x0004.0 0x0004.8 R 0x1 > > > + LOAD 0x1ffb.8 0x00000000003ffb.8 0x00000000003ffb.8 0x0004.0 0x000c.8 RW 0x200000 > > > + DYNAMIC 0x1ffb.0 0x00000000003ffb.0 0x00000000003ffb.0 0x0001.0 0x0001.0 RW 0x8 > > > + GNU_RELRO 0x1ffb.8 0x00000000003ffb.8 0x00000000003ffb.8 0x0004.0 0x0004.8 R 0x1 > > > > This change implies that the filesize increased by 2MB (and I verified > > this to be the case). I don't think that's a good trade-off. E.g. I have > > about 3500 binaries in /usr/bin/ alone. That linker change translates to > > an overall increase of 7 Gigabytes filesize. Right now all the files > > therein are about 1GB. > > > > So, please! > > Do they use 2MB pages? I missed the explicit '-z max-page-size=0x200000' in those tests link command and verified that not using it still generates small executables. Sorry for the noise, by default everything should be just fine. Ciao, Michael.