From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17077 invoked by alias); 30 Aug 2009 18:42:28 -0000 Received: (qmail 17068 invoked by uid 22791); 30 Aug 2009 18:42:28 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f222.google.com (HELO mail-ew0-f222.google.com) (209.85.219.222) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 30 Aug 2009 18:42:23 +0000 Received: by ewy22 with SMTP id 22so3474519ewy.28 for ; Sun, 30 Aug 2009 11:42:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.47.204 with SMTP id t54mr929487web.75.1251657740097; Sun, 30 Aug 2009 11:42:20 -0700 (PDT) In-Reply-To: <20090830054221.GM19523@bubble.grove.modra.org> References: <20090828000233.GA23692@lucon.org> <20090828031410.GC19523@bubble.grove.modra.org> <6dc9ffc80908272032p5b5a54a6h75caad74a27ffeda@mail.gmail.com> <6dc9ffc80908272055l3daa1368l1f84cfafcc07c2de@mail.gmail.com> <20090828055016.GE19523@bubble.grove.modra.org> <6dc9ffc80908280640q35b52922gda316d43127b7ab7@mail.gmail.com> <20090828143141.GK19523@bubble.grove.modra.org> <6dc9ffc80908280737q3b02c3e1ybfec435dd9307512@mail.gmail.com> <20090830054221.GM19523@bubble.grove.modra.org> Date: Mon, 31 Aug 2009 02:02:00 -0000 Message-ID: <6dc9ffc80908301142h6b7364cew9dca8f5198b366fa@mail.gmail.com> Subject: Re: PATCH: PR ld/10569: -z max-page-size may not work for linker scripts From: "H.J. Lu" To: "H.J. Lu" , binutils Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2009-08/txt/msg00563.txt.bz2 On Sat, Aug 29, 2009 at 10:42 PM, Alan Modra wrote: > On Fri, Aug 28, 2009 at 07:37:22AM -0700, H.J. Lu wrote: >> Output target can be different from emulation target. Emulation target >> may be ELF, which supports page sizes, while output target may not suppo= rt >> page sizes at all. We need to page sizes for both. > > Hmm, OK. =A0If we are doing something like an "--oformat srec" link, > then the bfd srec backend has no idea of page size, but the input > files might be ELF and we might be using an ELF ld script which > references MAXPAGESIZE. > > So the linker needs to know maxpagesize independently of the output. > It just happens that the linker already has config.maxpagesize, so > let's use that in ldexp.c. =A0We will need to get config.maxpagesize > from the bfd emulation target early in the link process, before we've > parsed -z maxpagesize, and pass any changed value back before final > link time. > What should happen case where 1. No -z page size command line option is given. 2. Output target is ELF and whose page size is different from default targe= t. Your checkin changes the output page size to the page size of the default target. --=20 H.J.