aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-03-08 04:38:45 +0000
committerAlan Modra <amodra@gmail.com>2007-03-08 04:38:45 +0000
commit91eb6c46deee80bf5993d1316f13afe85cf0455f (patch)
treee4812029f104155cabfb63a1c2ac7f342a2c1bfc /ld/ldlang.c
parentcb9f45d79f855f7e1d0b15dca0a0e51e0a8f5def (diff)
downloadgdb-91eb6c46deee80bf5993d1316f13afe85cf0455f.zip
gdb-91eb6c46deee80bf5993d1316f13afe85cf0455f.tar.gz
gdb-91eb6c46deee80bf5993d1316f13afe85cf0455f.tar.bz2
* ldlang.c (lang_size_sections_1): Correct backwards dot move
test to not trigger on overlays. Only warn on backwards move if non-default lma.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index fa597f3..380f487 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -4411,19 +4411,21 @@ lang_size_sections_1
/* 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
+ os->load_base set) because backwards moves can
create overlapping LMAs. */
if (dot < last->vma
- && os->bfd_section->size != 0)
+ && os->bfd_section->size != 0
+ && dot + os->bfd_section->size <= 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. */
+ sufficiently large. Nag if this changes anything,
+ so people can fix their linker scripts. */
+
+ if (last->vma != last->lma)
+ einfo (_("%P: warning: dot moved backwards before `%s'\n"),
+ os->name);
}
else
{