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: ld lma assignment


On Tue, Aug 22, 2006 at 05:03:44PM +0930, Alan Modra wrote:
>  	      {
>  		bfd_vma lma;
>  		asection *last;
>  
>  		last = r->last_os->output_section_statement.bfd_section;
> -		/* If dot moved backwards (which is invalid according
> -		   to ld docs) then leave lma equal to vma.  This
> -		   keeps users of buggy ld scripts happy.  */
> -		if (dot >= last->vma)
> +
> +		/* A backwards move of dot should be accompanied by
> +		   an explicit assignment to the section LMA (ie.
> +		   os->load_base set) because backwards moves normally
> +		   create overlapping LMAs.  */
> +		if (dot < last->vma)
> +		  {
> +		    einfo (_("%P: warning: dot moved backwards before `%s'\n"),
> +			   os->name);
> +
> +		    /* If dot moved backwards then leave lma equal to
> +		       vma.  This is the old default lma, which might
> +		       just happen to work when the backwards move is
> +		       sufficiently large.  Nag anyway, so people fix
> +		       their linker scripts.  */
> +		  }
> +		else
>  		  {


There are 2 issues:

1. It doesn't check if there are overlapping LMAs when warning moving
dot backwards.
2. I don't think we should change lma just because dot is moved
backwards. We can change the affected linker scripts if they can be
made backward compatible.


H.J.


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