aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-02-19 14:08:31 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-02-19 14:08:31 +0000
commit384d938fc857ab8529254abf9261c6b57a069a53 (patch)
treef0d349875928d63baa54f7a48f4233b17720313b /ld/ldlang.c
parenta8a6d7cef4feec69589446caa82f1236e3e3f6d6 (diff)
downloadgdb-384d938fc857ab8529254abf9261c6b57a069a53.zip
gdb-384d938fc857ab8529254abf9261c6b57a069a53.tar.gz
gdb-384d938fc857ab8529254abf9261c6b57a069a53.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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c9
1 files changed, 7 insertions, 2 deletions
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;