This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld lma assignment
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sourceware dot org
- Date: Tue, 22 Aug 2006 11:04:15 -0700
- Subject: Re: ld lma assignment
- References: <20060726050914.GK6872@bubble.grove.modra.org> <20060822073344.GB23819@bubble.grove.modra.org>
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.