aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-09-19 23:17:47 +0000
committerAlan Modra <amodra@gmail.com>2005-09-19 23:17:47 +0000
commita5df8c84e0691cfdf17acb6d69e1c2fd428a5f97 (patch)
tree81d5d3479d0f4c1866d747d144a4f2e50bccef46
parentc761af65c26cb42164db70ecc5af964e4d631156 (diff)
downloadgdb-a5df8c84e0691cfdf17acb6d69e1c2fd428a5f97.zip
gdb-a5df8c84e0691cfdf17acb6d69e1c2fd428a5f97.tar.gz
gdb-a5df8c84e0691cfdf17acb6d69e1c2fd428a5f97.tar.bz2
PR ld/1353
* ldlang.c (lang_size_sections_1): Process addr_tree earlier, so that unused output section statements affect dot.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/ldlang.c32
2 files changed, 22 insertions, 16 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 582ab6f..c888d68 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-20 Alan Modra <amodra@bigpond.net.au>
+
+ PR ld/1353
+ * ldlang.c (lang_size_sections_1): Process addr_tree earlier,
+ so that unused output section statements affect dot.
+
2005-09-08 Jakub Jelinek <jakub@redhat.com>
* ld.texinfo: Document -z {no,}execstack, -z {no,}relro
diff --git a/ld/ldlang.c b/ld/ldlang.c
index fb5454c..09e5f56 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3974,6 +3974,21 @@ lang_size_sections_1
lang_output_section_statement_type *os;
os = &s->output_section_statement;
+ if (os->addr_tree != NULL)
+ {
+ os->processed = -1;
+ exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, &dot);
+ os->processed = 0;
+
+ if (!expld.result.valid_p
+ && 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)
/* This section was removed or never actually created. */
break;
@@ -4003,6 +4018,7 @@ lang_size_sections_1
break;
}
+ newdot = dot;
if (bfd_is_abs_section (os->bfd_section))
{
/* No matter what happens, an abs section starts at zero. */
@@ -4074,22 +4090,6 @@ lang_size_sections_1
os->name, (unsigned long) (newdot - savedot));
}
}
- else
- {
- newdot = dot;
- os->processed = -1;
- exp_fold_tree (os->addr_tree, bfd_abs_section_ptr,
- &newdot);
- os->processed = 0;
-
- if (!expld.result.valid_p
- && expld.phase != lang_mark_phase_enum)
- einfo (_("%F%S: non constant or forward reference"
- " address expression for section %s\n"),
- os->name);
-
- newdot = expld.result.value + expld.result.section->vma;
- }
/* The section starts here.
First, align to what the section needs. */