diff options
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r-- | ld/ldexp.c | 45 |
1 files changed, 26 insertions, 19 deletions
@@ -974,37 +974,44 @@ exp_nameop (int code, const char *name) } -etree_type * -exp_assop (int code, const char *dst, etree_type *src) -{ - etree_type *new_e; - - new_e = (etree_type *) stat_alloc (sizeof (new_e->assign)); - new_e->type.node_code = code; - new_e->type.lineno = src->type.lineno; - new_e->type.node_class = etree_assign; - new_e->assign.src = src; - new_e->assign.dst = dst; - return new_e; -} - -/* Handle PROVIDE. */ - -etree_type * -exp_provide (const char *dst, etree_type *src, bfd_boolean hidden) +static etree_type * +exp_assop (const char *dst, + etree_type *src, + enum node_tree_enum class, + bfd_boolean hidden) { etree_type *n; n = (etree_type *) stat_alloc (sizeof (n->assign)); n->assign.type.node_code = '='; n->assign.type.lineno = src->type.lineno; - n->assign.type.node_class = etree_provide; + n->assign.type.node_class = class; n->assign.src = src; n->assign.dst = dst; n->assign.hidden = hidden; return n; } +etree_type * +exp_assign (const char *dst, etree_type *src) +{ + return exp_assop (dst, src, etree_assign, FALSE); +} + +etree_type * +exp_defsym (const char *dst, etree_type *src) +{ + return exp_assop (dst, src, etree_assign, TRUE); +} + +/* Handle PROVIDE. */ + +etree_type * +exp_provide (const char *dst, etree_type *src, bfd_boolean hidden) +{ + return exp_assop (dst, src, etree_provide, hidden); +} + /* Handle ASSERT. */ etree_type * |