From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62775 invoked by alias); 28 Mar 2015 18:30:06 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 62756 invoked by uid 89); 28 Mar 2015 18:30:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f175.google.com Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 28 Mar 2015 18:30:04 +0000 Received: by obcjt1 with SMTP id jt1so93466059obc.2 for ; Sat, 28 Mar 2015 11:30:02 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.78.72 with SMTP id z8mr20603895oew.13.1427567402796; Sat, 28 Mar 2015 11:30:02 -0700 (PDT) Received: by 10.76.134.102 with HTTP; Sat, 28 Mar 2015 11:30:02 -0700 (PDT) In-Reply-To: <20150328041540.GE26234@bubble.grove.modra.org> References: <20150319130244.GA22592@intel.com> <20150326022246.GU26234@bubble.grove.modra.org> <20150328041540.GE26234@bubble.grove.modra.org> Date: Sat, 28 Mar 2015 18:30:00 -0000 Message-ID: Subject: Re: [PATCH] Reduce file size for PT_GNU_RELRO segment From: "H.J. Lu" To: Binutils Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00426.txt.bz2 On Fri, Mar 27, 2015 at 9:15 PM, Alan Modra wrote: > On Fri, Mar 27, 2015 at 01:00:20PM -0700, H.J. Lu wrote: >> On Wed, Mar 25, 2015 at 7:22 PM, Alan Modra wrote: >> > Isn't this just re-inventing the commonpage adjustment done for >> > DATA_SEGMENT_ALIGN? Why didn't the existing code in ldexp.c work for >> > you? >> >> segment. In order to properly align PT_GNU_RELRO segment, we pad the first >> section of PT_GNU_RELRO segment by > > Adjusting the start of the first section of the PT_GNU_RELRO segment > is exactly what DATA_SEGMENT_ALIGN is supposed to do. You are > patching the wrong place. Any adjustment to the start of the relro > segment belongs in ldexp.c code evaluating DATA_SEGMENT_ALIGN. > Since output_section_statement isn't passed to ldexp.c, I don't see how DATA_SEGMENT_ALIGN in ldexp.c can check the section address and size. -- H.J.