aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 9aad092..326a0aa 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -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 *