Large data sections support
Jakub Jelinek
jakub@redhat.com
Sun Jun 12 22:23:00 GMT 2005
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
More information about the Binutils
mailing list