mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
* ldlang.h (struct lang_output_section_state): Change processed
field's type. * ldexp.c (check, invalid): Remove. (fold_name): Move valid_p assignments. Create undefined symbol when needed. Directly exampine section's processd flag. * ldlang.c (lang_output_section_statement_lookup): Adjust processed field init. (lang_size_sections_1): Allow LOADADDR when determining section's VMA. Adjust error message. Fold data statement's expr. (lang_size_sections): Correctly increment lang_statement_iteration. * ld-scripts/provide.exp: New. * ld-scripts/provide-{1,2,3}.{s,t,d}.exp: New. * ldexp.c (fold_tree): Follow indirect symbols.
This commit is contained in:
15
ld/ldlang.c
15
ld/ldlang.c
@ -622,7 +622,7 @@ lang_output_section_statement_lookup (const char *const name)
|
||||
|
||||
lookup->next = NULL;
|
||||
lookup->bfd_section = NULL;
|
||||
lookup->processed = FALSE;
|
||||
lookup->processed = 0;
|
||||
lookup->sectype = normal_section;
|
||||
lookup->addr_tree = NULL;
|
||||
lang_list_init (&lookup->children);
|
||||
@ -2984,12 +2984,15 @@ lang_size_sections_1
|
||||
{
|
||||
etree_value_type r;
|
||||
|
||||
os->processed = -1;
|
||||
r = exp_fold_tree (os->addr_tree,
|
||||
abs_output_section,
|
||||
lang_allocating_phase_enum,
|
||||
dot, &dot);
|
||||
os->processed = 0;
|
||||
|
||||
if (!r.valid_p)
|
||||
einfo (_("%F%S: non constant address expression for section %s\n"),
|
||||
einfo (_("%F%S: non constant or forward reference address expression for section %s\n"),
|
||||
os->name);
|
||||
|
||||
dot = r.value + r.section->bfd_section->vma;
|
||||
@ -3027,7 +3030,7 @@ lang_size_sections_1
|
||||
= TO_SIZE (after - os->bfd_section->vma);
|
||||
|
||||
dot = os->bfd_section->vma + TO_ADDR (os->bfd_section->_raw_size);
|
||||
os->processed = TRUE;
|
||||
os->processed = 1;
|
||||
|
||||
if (os->update_dot_tree != 0)
|
||||
exp_fold_tree (os->update_dot_tree, abs_output_section,
|
||||
@ -3089,6 +3092,11 @@ lang_size_sections_1
|
||||
s->data_statement.output_section =
|
||||
output_section_statement->bfd_section;
|
||||
|
||||
/* We might refer to provided symbols in the expression, and
|
||||
need to mark them as needed. */
|
||||
exp_fold_tree (s->data_statement.exp, abs_output_section,
|
||||
lang_allocating_phase_enum, dot, &dot);
|
||||
|
||||
switch (s->data_statement.type)
|
||||
{
|
||||
default:
|
||||
@ -3294,6 +3302,7 @@ lang_size_sections
|
||||
&& first + last <= exp_data_seg.pagesize)
|
||||
{
|
||||
exp_data_seg.phase = exp_dataseg_adjust;
|
||||
lang_statement_iteration++;
|
||||
result = lang_size_sections_1 (s, output_section_statement, prev,
|
||||
fill, dot, relax, check_regions);
|
||||
}
|
||||
|
Reference in New Issue
Block a user