PR 4782
authorAlan Modra <amodra@gmail.com>
Thu, 12 Jul 2007 01:40:25 +0000 (01:40 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 12 Jul 2007 01:40:25 +0000 (01:40 +0000)
* ldlang.c (lang_size_sections_1 <output_section_statement>): Only
use expld.result when valid.

ld/ChangeLog
ld/ldlang.c

index bf73bb479390599f4b6f4e94a69f6985a083f200..0d1bcc78b391728a71b0eae3f6785f198873bf13 100644 (file)
@@ -1,3 +1,9 @@
+2007-07-12  Alan Modra  <amodra@bigpond.net.au>
+
+       PR 4782
+       * ldlang.c (lang_size_sections_1 <output_section_statement>): Only
+       use expld.result when valid.
+
 2007-07-12  Alan Modra  <amodra@bigpond.net.au>
 
        * emultempl/spuelf.em (embedded_spu_file): Test for NULL path
index e1c02cc441c22452d71b1f93dab64fbd3662e015..56edee80a1dab226861a813d92e75257fad46bcb 100644 (file)
@@ -4242,13 +4242,12 @@ lang_size_sections_1
                os->processed_vma = FALSE;
                exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, &dot);
 
-               if (!expld.result.valid_p
-                   && expld.phase != lang_mark_phase_enum)
+               if (expld.result.valid_p)
+                 dot = expld.result.value + expld.result.section->vma;
+               else if (expld.phase != lang_mark_phase_enum)
                  einfo (_("%F%S: non constant or forward reference"
                           " address expression for section %s\n"),
                         os->name);
-
-               dot = expld.result.value + expld.result.section->vma;
              }
 
            if (os->bfd_section == NULL)