This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix occasional 2MB gap in the linked binary


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]