From owner-freebsd-current@FreeBSD.ORG Mon Jun 29 09:05:21 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461E11065687; Mon, 29 Jun 2009 09:05:21 +0000 (UTC) (envelope-from freebsd.work@gmail.com) Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.210.181]) by mx1.freebsd.org (Postfix) with ESMTP id CC9A88FC2D; Mon, 29 Jun 2009 09:05:20 +0000 (UTC) (envelope-from freebsd.work@gmail.com) Received: by yxe11 with SMTP id 11so3621746yxe.3 for ; Mon, 29 Jun 2009 02:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EGpIuYrPQXXsZH30xGkRylFJ19/f21MxbfNCZevNnsk=; b=tWhlVL2NRA1/zckviHF+CqktzXAcg8MAyHTAcuGmgo8rY+UFe6NwzkLNNR85185W74 N4CIVF/q/lxTUmof2NLsZnlgD31l9oK3w3OzLnH9byrZBV9zFiEp9A4G9q87BNyN9afu NG6/94nCXZmuPBpOYOURbG08QiZvhdHLNBaOI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eIcGT+ss5t48ZLLzYS4oW1r1OOILQt3tR1DBBdBZUTrFGlnlxFKPVbL0XXvkrnRhbD pXNwo05/xjOPxQekrRM7gP9sSJ/vnjdY9glbQMsFL6JQVK3zSuzcSGeQiriKSrX91nkg t5L5K5SQqswHwn6rAc0m/8fr1l3V3FwAKNK74= MIME-Version: 1.0 Received: by 10.231.14.129 with SMTP id g1mr604091iba.16.1246266319569; Mon, 29 Jun 2009 02:05:19 -0700 (PDT) In-Reply-To: References: <45d874490906281642r470089e2sc5b770f239f428e2@mail.gmail.com> Date: Mon, 29 Jun 2009 02:05:19 -0700 Message-ID: <45d874490906290205h41c6d08ajfdc0d4cf012f5389@mail.gmail.com> From: "Sean P. Dew" To: alc@freebsd.org, freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: segment alignment in AMD64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2009 09:05:21 -0000 I applied this patch to modify the MAXPAGE size to 4K instead of 1 MB. Do I need to rebuild the toolchain? I have not been able to execute the genscripts.sh for generating the ld scripts. I tried to run the "make" in /usr/src/gnu/usr.bin/binutils/ld/ but got the following error. Any help is appreciated. Thanks a million libintl.h: No such file or directory Thanks Sean Index: /usr/src/contrib/binutils/ld/emulparams/elf_x86_64.sh =================================================================== RCS file: /usr/ncvs/src/contrib/binutils/ld/emulparams/elf_x86_64.sh,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 elf_x86_64.sh --- /usr/src/contrib/binutils/ld/emulparams/elf_x86_64.sh 16 Jun 2004 05:45:40 -0000 1.1.1.6 +++ /usr/src/contrib/binutils/ld/emulparams/elf_x86_64.sh 7 Sep 2007 00:20:31 -0000 @@ -2,7 +2,7 @@ ELFSIZE=64 OUTPUT_FORMAT="elf64-x86-64" TEXT_START_ADDR=0x400000 -MAXPAGESIZE=0x100000 +MAXPAGESIZE=0x1000 COMMONPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x400000 ARCH="i386:x86-64" ------------------------------------------------------------------------------------------------------------------ On Sun, Jun 28, 2009 at 5:37 PM, Alan Cox wrote: > On Sun, Jun 28, 2009 at 6:42 PM, Sean P. Dew wrote: > >> Hi, >> >> Why is a loadable segment aligned to 1 MB on AMD64 while the pagezie is >> still 4K for a user application. Is there anyway to change it back to 4K, >> It >> is not making sense to me is because if my file segment is around 400K, we >> are wasting 1 MB of virtual address space ( granted it is not a lot for >> X64). I am trying to find out the reason. I am posting the readelf output >> of a .so. Any help is appreciated. >> > > You'll find this question discussed in the mailing list archives on more > than one occasion. Here is one such message: > > http://lists.freebsd.org/pipermail/freebsd-amd64/2007-September/010260.html > > To be a little more explicit, it is done to increase the likelihood that > the entire code segment of a large program can be mapped using 2 MB page > mappings. Moreover, to be able to do so without wasting any physical memory > on padding. Although we have the necessary 2 MB page support in the virtual > memory system, the kernel's image activator hasn't been modified to take > advantage of this. Only a few programs with large code and data segments, > e.g., emacs, will benefit. > > Regards, > Alan > >