This is the mail archive of the binutils@sources.redhat.com 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: possible BFD regression from a change made last September


Alan Modra wrote:
On Tue, May 17, 2005 at 10:15:32AM -0700, Bob Wilson wrote:

If the page size is not 1, I can see how this case is now handled by:

		  /* The section VMA must equal the file position
		     modulo the page size.  */
		  bfd_size_type page = align;
		  if ((abfd->flags & D_PAGED) != 0)
		    page = bed->maxpagesize;
		  adjust = vma_page_aligned_bias (sec->vma,
						  p->p_vaddr + p->p_memsz,
						  page);
		  p->p_memsz += adjust;

but that breaks in my scenario where align == 16 but maxpagesize == 1.


We ought to be taking the maximum of align and maxpagesize.  I think the
following should do the trick.

	* elf.c (assign_file_positions_for_segments): Use maximum of
	maxpagesize and section alignment when adjusting initial
	segment offset and section offsets.

Yes, indeed, that fixes it. Thanks for the patch!


--Bob


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