diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-02-19 16:22:19 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2004-02-19 16:22:19 +0000 |
commit | f657eb012f01b080bea105b973b53b87a0a07ddd (patch) | |
tree | 27dabd204d775446f3c5480eca5cb7348af9214c | |
parent | 846374793219da8e51b8f3f4460a9ffb59220fca (diff) | |
download | gdb-f657eb012f01b080bea105b973b53b87a0a07ddd.zip gdb-f657eb012f01b080bea105b973b53b87a0a07ddd.tar.gz gdb-f657eb012f01b080bea105b973b53b87a0a07ddd.tar.bz2 |
* ldlang.c (map_input_to_output_sections): Initialize sections
mentioned in a data statement expression.
(lang_do_assignments_1): Add data statement's expression's
section's vma.
* ld-scripts/data.{s,t,d,exp}: New.
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/ldlang.c | 9 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 4 |
3 files changed, 18 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index fc4b1be..3b3516e 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2004-02-19 Nathan Sidwell <nathan@codesourcery.com> + + * ldlang.c (map_input_to_output_sections): Initialize sections + mentioned in a data statement expression. + (lang_do_assignments_1): Add data statement's expression's + section's vma. + 2004-02-18 Nathan Sidwell <nathan@codesourcery.com> * ldgram.y (statement_anywhere): Add assert rule. diff --git a/ld/ldlang.c b/ld/ldlang.c index 487ee02..a25f5f3 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -2098,10 +2098,14 @@ map_input_to_output_sections target, output_section_statement); break; + case lang_data_statement_enum: + /* Make sure that any sections mentioned in the expression + are initialized. */ + exp_init_os (s->data_statement.exp); + /* FALLTHROUGH */ case lang_fill_statement_enum: case lang_input_section_enum: case lang_object_symbols_statement_enum: - case lang_data_statement_enum: case lang_reloc_statement_enum: case lang_padding_statement_enum: case lang_input_statement_enum: @@ -3375,9 +3379,10 @@ lang_do_assignments_1 value = exp_fold_tree (s->data_statement.exp, abs_output_section, lang_final_phase_enum, dot, &dot); - s->data_statement.value = value.value; if (!value.valid_p) einfo (_("%F%P: invalid data statement\n")); + s->data_statement.value + = value.value + value.section->bfd_section->vma; } { unsigned int size; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 282ee0c..23e41a9 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-02-19 Nathan Sidwell <nathan@codesourcery.com> + + * ld-scripts/data.{s,t,d,exp}: New. + 2004-02-18 Nathan Sidwell <nathan@codesourcery.com> * ld-scripts/assert.{s,t,exp}: New. |