diff options
author | Alan Modra <amodra@gmail.com> | 2007-02-06 13:56:38 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2007-02-06 13:56:38 +0000 |
commit | 264b62058b585d4bee3ef4ffa804fce7400df80e (patch) | |
tree | 23532e5bdcb51ff60091a3274080ec9b0f38a448 /ld/ldlang.c | |
parent | ba8ce02d29c4e898410ae76d33f3f5e8dcf5e175 (diff) | |
download | gdb-264b62058b585d4bee3ef4ffa804fce7400df80e.zip gdb-264b62058b585d4bee3ef4ffa804fce7400df80e.tar.gz gdb-264b62058b585d4bee3ef4ffa804fce7400df80e.tar.bz2 |
* ldlang.c (lang_size_sections_1): Don't warn on backwards dot
move unless section size is non-zero.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 030887d..ac680a5 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -1,6 +1,6 @@ /* Linker command language support. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -4413,7 +4413,8 @@ lang_size_sections_1 an explicit assignment to the section LMA (ie. os->load_base set) because backwards moves normally create overlapping LMAs. */ - if (dot < last->vma) + if (dot < last->vma + && os->bfd_section->size != 0) { einfo (_("%P: warning: dot moved backwards before `%s'\n"), os->name); @@ -4463,8 +4464,11 @@ lang_size_sections_1 || (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0) && (os->bfd_section->flags & SEC_ALLOC) != 0 && (os->bfd_section->size != 0 - || os->bfd_section->vma != os->bfd_section->lma - || r->last_os != NULL) + || (r->last_os == NULL + && os->bfd_section->vma != os->bfd_section->lma) + || (r->last_os != NULL + && dot >= (r->last_os->output_section_statement + .bfd_section->vma)) && os->lma_region == NULL && !link_info.relocatable) r->last_os = s; |