This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Large data sections support
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, binutils at sources dot redhat dot com
- Date: Mon, 13 Jun 2005 00:22:53 +0200
- Subject: Re: Large data sections support
- References: <20050612124135.GA15922@kam.mff.cuni.cz> <20050612210305.GA6355@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Jun 12, 2005 at 02:03:05PM -0700, Richard Henderson wrote:
> On Sun, Jun 12, 2005 at 02:41:35PM +0200, Jan Hubicka wrote:
> > + *(.dynlbss)
>
> In order to use dynlbss, you'd have to verify that all uses of a
> symbol are via medium model. And heaven forfend that users actually
> do reference a 1GB object from a shared library. *shudder*
>
> > + LRODATA=".lrodata ${RELOCATING-0} : { *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*}) }"
>
> You need to push LRODATA into a new page, so that it can be marked
> read-only. See how we start a new page when changing to the data
> segment after the regular .rodata section.
>
> You probably should think about ordering the sections like so:
>
> .bss
> .lbss
> .ldata
> .lrodata
>
> In this way you could arrange for .lbss to be put in the same
> segment as .bss, which makes for a larger contiguous block of
> zeros. It could also avoid the need for another segment at all,
> if .lbss is the only one of the three that's non-empty.
>
> Putting the .ldata section next means that you don't have to
> do the whole push to a new page thing again, since .lbss and
> .ldata generally have the same set of permissions.
But if the last segment is not writable, there will be problems
with the heap, unless _end is page aligned. But as x86-64 ABI
allows up to 1MB page sizes, that would mean aligning it to 1MB
boundary.
Jakub