possible BFD regression from a change made last September

Bob Wilson bwilson@tensilica.com
Wed May 18 17:12:00 GMT 2005


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



More information about the Binutils mailing list