Subject: Re: MIPS binary sizes with binutils 2.15
To: Simon Burge <simonb@wasabisystems.com>
From: Chuck Silvers <chuq@chuq.com>
List: tech-toolchain
Date: 11/18/2005 08:10:56
On Fri, Nov 18, 2005 at 10:59:00PM +1100, Simon Burge wrote:
> For at least the 3.0 release I'd like to add one of two changes to
> NetBSD:
> 
>  1) Revert ELF_MAXPAGESIZE back to 0x1000 (4kB)
> 
>  2) Remove the text/data gap.
> 
> Reasons for 1) are "this is the way it's always been" prior to binutils
> 2.15, and so has effectively been tested pretty much forever.
> 
> Reasons for 2) are that this is the way binutils does it now, and that
> it follows the MIPS ELF spec.
> 
> I'm personally leaning towards 1) because even though we will be
> violating the MIPS ELF spec, the implications of are well known because
> we've always violated the spec in this regard, and I don't see it as a
> big change leading up to the NetBSD 3.0 release compared with moving the
> data section directly to the end of the text section.
> 
> Comments?


there's another option, which is what the other VIPT-cache platforms do:
put the text and data right together in the file, but map the page
containing the text/data boundary twice:


sparc:
 10 .rodata       000000e8  00010bd8  00010bd8  00000bd8  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .data         0000000c  00020cc0  00020cc0  00000cc0  2**2
                  CONTENTS, ALLOC, LOAD, DATA

sparc64:
 10 .rodata       000000c0  0000000000100c70  0000000000100c70  00000c70  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .data         00000008  0000000000200d30  0000000000200d30  00000d30  2**3
                  CONTENTS, ALLOC, LOAD, DATA

hppa:
 10 .rodata       00000045  00100bf0  00100bf0  00000bf0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .copyright    00000064  00100c38  00100c38  00000c38  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 12 .PARISC.unwind 00000100  00100c9c  00100c9c  00000c9c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 13 .data         00000028  00200d9c  00200d9c  00000d9c  2**2
                  CONTENTS, ALLOC, LOAD, DATA


is this style permitted by the MIPS ELF spec?

-Chuck