From e092cb30d23375162df46825e5b5bc99a339245b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 14 May 2010 03:15:20 +0000 Subject: [PATCH] PR ld/11583 * ldexp.c (exp_fold_tree_1): If assignment source expression is invalid, make the destination symbol undefined. --- ld/ChangeLog | 6 ++++++ ld/ldexp.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index 7fa12d771c3..ca76b051652 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2010-05-14 Alan Modra + + PR ld/11583 + * ldexp.c (exp_fold_tree_1): If assignment source expression is + invalid, make the destination symbol undefined. + 2010-05-11 Kai Tietz * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): diff --git a/ld/ldexp.c b/ld/ldexp.c index 7fdf7f40587..34d9eabde7f 100644 --- a/ld/ldexp.c +++ b/ld/ldexp.c @@ -830,6 +830,14 @@ exp_fold_tree_1 (etree_type *tree) hsrc); } } + else if (expld.phase == lang_final_phase_enum) + { + h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, + FALSE, FALSE, TRUE); + if (h != NULL + && h->type == bfd_link_hash_new) + h->type = bfd_link_hash_undefined; + } } break; -- 2.30.2