This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Fix pr4782
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Thu, 12 Jul 2007 11:08:57 +0930
- Subject: Fix pr4782
PR 4782
* ldlang.c (lang_size_sections_1 <output_section_statement>): Only
use expld.result when valid.
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.265
diff -u -p -r1.265 ldlang.c
--- ld/ldlang.c 6 Jul 2007 14:09:41 -0000 1.265
+++ ld/ldlang.c 12 Jul 2007 01:19:53 -0000
@@ -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)
--
Alan Modra
Australia Development Lab, IBM