forked from Imagelibrary/binutils-gdb
PR ld/12356
* ld.texinfo (Miscellaneous Commands): Describe LD_FEATURE. (Expression Section): Update. * ld.h (ld_config_type): Add sane_expr. * ldgram.y (ifile_p1): Add LD_FEATURE. * ldlex.l (LD_FEATYRE): New. * ldemul.c (after_parse_default): Delete code handling ld_compatibility. * ldexp.h (struct ldexp_control): Delete uses_defined. * ldexp.c: Remove all uses of uses_defined. (fold_name): Test config.sane_expr rather than ld_compatibility. (exp_fold_tree_1): Likewise. Adjust handling of assignments during first phase. * ldlang.h (ld_compatibility): Delete. (lang_ld_feature): Declare. * ldlang.c (ld_compatibility): Delete. (open_input_bfds): Only handle assignments for --defsym. (lang_ld_feature): New function.
This commit is contained in:
10
ld/ldexp.c
10
ld/ldexp.c
@@ -512,7 +512,6 @@ fold_name (etree_type *tree)
|
||||
break;
|
||||
|
||||
case DEFINED:
|
||||
expld.uses_defined = TRUE;
|
||||
if (expld.phase == lang_first_phase_enum)
|
||||
lang_track_definedness (tree->name.name);
|
||||
else
|
||||
@@ -564,7 +563,7 @@ fold_name (etree_type *tree)
|
||||
}
|
||||
else if (output_section == bfd_abs_section_ptr
|
||||
&& (expld.section != bfd_abs_section_ptr
|
||||
|| ld_compatibility >= 221))
|
||||
|| config.sane_expr))
|
||||
new_number (h->u.def.value + h->u.def.section->output_offset);
|
||||
else
|
||||
new_rel (h->u.def.value + h->u.def.section->output_offset,
|
||||
@@ -712,7 +711,7 @@ exp_fold_tree_1 (etree_type *tree)
|
||||
{
|
||||
case etree_value:
|
||||
if (expld.section == bfd_abs_section_ptr
|
||||
&& ld_compatibility < 221)
|
||||
&& !config.sane_expr)
|
||||
new_abs (tree->value.value);
|
||||
else
|
||||
new_number (tree->value.value);
|
||||
@@ -819,7 +818,8 @@ exp_fold_tree_1 (etree_type *tree)
|
||||
exp_fold_tree_1 (tree->assign.src);
|
||||
if (expld.result.valid_p
|
||||
|| (expld.phase == lang_first_phase_enum
|
||||
&& !expld.uses_defined))
|
||||
&& tree->type.node_class == etree_assign
|
||||
&& tree->assign.hidden))
|
||||
{
|
||||
if (h == NULL)
|
||||
{
|
||||
@@ -883,7 +883,6 @@ exp_fold_tree (etree_type *tree, asection *current_section, bfd_vma *dotp)
|
||||
expld.dot = *dotp;
|
||||
expld.dotp = dotp;
|
||||
expld.section = current_section;
|
||||
expld.uses_defined = FALSE;
|
||||
exp_fold_tree_1 (tree);
|
||||
}
|
||||
|
||||
@@ -893,7 +892,6 @@ exp_fold_tree_no_dot (etree_type *tree)
|
||||
expld.dot = 0;
|
||||
expld.dotp = NULL;
|
||||
expld.section = bfd_abs_section_ptr;
|
||||
expld.uses_defined = FALSE;
|
||||
exp_fold_tree_1 (tree);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user