From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 689A73858D20 for ; Tue, 15 Feb 2022 14:42:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 689A73858D20 Received: by mail-pl1-x630.google.com with SMTP id l9so11640822plg.0 for ; Tue, 15 Feb 2022 06:42:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+d4MDLfFscpISAvK99wOP27SMMRsYfDq3akaTUBSfwE=; b=YBKJt1W24oXgh+OAc16NwCFnFAOtB+7Azy3Vb+Sbm7eH7UmQi/RCm5E/ihVD1eTSfv +14AaA+LW8/oFccDA8U4XPWekjW0U3K5yLMdBwCfByQr4qNFxgyailsBh5bcpQw7hehn fHGpJm+28K3ln+9R5NEfLfll6cg95V9ZPt4qwAS1XNJFWOxSTVUN0Bo5mbQE9HFqG6zN JzOtxYfo5Ya2o4u+/gNASk6RgsqZ0fxrPp1EbHwXRYX1sXQx2R3aBXSEhCLy9Q+LcUoe 5cNrKLr10KzCTAE5to4viiJjQrOxi1HEtn7OKMuHsgJaIyEzZNScDddmZuYrGUZjdR25 w/Yg== X-Gm-Message-State: AOAM53174APecCiQwRVZeWPKhA3P9oXJWpT6lCjI6gCVd3i/pa/67nWD xqJu5cbvQTurhTwR772AI6XT0pi4gKZn9QhYNtN200jG X-Google-Smtp-Source: ABdhPJwcE3euKKb8FjUeWW3HgXQ3VDUklp0IWB/03uJEfBINgeVCytwvkNbHKmdmYosKyMAugIAvoaKPONqKY+SAXDk= X-Received: by 2002:a17:90a:c68c:b0:1b9:c16a:35d3 with SMTP id n12-20020a17090ac68c00b001b9c16a35d3mr4708530pjt.120.1644936138780; Tue, 15 Feb 2022 06:42:18 -0800 (PST) MIME-Version: 1.0 References: <20220215011026.738505-1-hjl.tools@gmail.com> <20220215011026.738505-2-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 15 Feb 2022 06:41:42 -0800 Message-ID: Subject: Re: [PATCH 2/2] x86-64: Use MAXPAGESIZE for the relro segment alignment To: Michael Matz Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3021.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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:42:22 -0000 On Tue, Feb 15, 2022 at 6:08 AM Michael Matz wrote: > > Hello, > > On Mon, 14 Feb 2022, H.J. Lu via Binutils 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? -- H.J.