This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Fix occasional 2MB gap in the linked binary
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 13 Aug 2008 14:43:41 +0930
- Subject: Re: [patch] Fix occasional 2MB gap in the linked binary
- References: <20080811130329.GA19287@host0.dyn.jankratochvil.net>
On Mon, Aug 11, 2008 at 03:03:29PM +0200, Jan Kratochvil wrote:
> - expld.dataseg.min_base = align_n (expld.dot, maxpage);
> +
> + /* Required is only `align_n (expld.dot, maxpage)' to
> + separate the runtime MAXPAGE mapping of the
> + writable data segment from the previous readonly
> + segment. We still force even at least the same
> + offset inside MAXPAGE as if we would assign VMA
> + between MAXPAGE..MAXPAGE+DOT the file-offset for
> + the data segment start would have to be another
> + almost MAXPAGE higher to get it congruent modulo
> + MAXPAGE for the runtime mapping. */
> + expld.dataseg.min_base = expld.dot;
> + if (expld.dataseg.min_base & (maxpage - 1))
> + expld.dataseg.min_base += maxpage;
I was hoping Jakub would review this change since it is his code..
My opinion is that this would be cleaner if you just saved dot to
min_base here, and moved all the aligning and tweaking to one place,
in ldlang.c.
--
Alan Modra
Australia Development Lab, IBM