aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-08-06 22:27:52 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-08-06 22:27:52 +0000
commiteb8476a6e2fc115c0a953392e61ab27c7568a2a8 (patch)
tree30b9014e6f4c62bd312650473ada0a1cc4b315a8 /ld/ldexp.c
parentde88229846525b2afb4a8b85b7f60f3246d3e90d (diff)
downloadbinutils-eb8476a6e2fc115c0a953392e61ab27c7568a2a8.zip
binutils-eb8476a6e2fc115c0a953392e61ab27c7568a2a8.tar.gz
binutils-eb8476a6e2fc115c0a953392e61ab27c7568a2a8.tar.bz2
bfd/
* elflink.c (bfd_elf_record_link_assignment): Remove --defsym symbols special case. ld/ * ldexp.h (etree_union): Add defsym member to the assign member structure. (exp_assign): Add hidden argument to prototype. * ldexp.c (exp_fold_tree_1): Use the defsym member to handle --defsym symbols. (exp_assop): Add defsym argument, initialize the defsym member of the assign structure. (exp_assign): Handle hidden symbols. (exp_defsym): Update to use the defsym argument to exp_assop. (exp_provide): Update to handle the defsym argument to exp_assop. * ldlex.l (HIDDEN): New token. * ldgram.y (HIDDEN): Likewise. (assignment, section): Update calls to exp_assign. * ldctor.c (ldctor_build_sets): Likewise. * mri.c (mri_format): Likewise. * ldlang.c (lang_insert_orphan, lang_leave_overlay): Likewise. (open_input_bfds): Remove --defsym symbols special case. * emultempl/beos.em (gld_${EMULATION_NAME}_set_symbols): Update call to exp_assign. * emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/spuelf.em (spu_place_special_section): Likewise. * emultempl/xtensaelf.em (ld_xtensa_insert_page_offsets): Likewise. * ld.texinfo (Assigning Values to Symbols): Add HIDDEN. (HIDDEN): New subsection.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index be296bc..cc43b72 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -892,7 +892,7 @@ exp_fold_tree_1 (etree_type *tree)
if (expld.result.valid_p
|| (expld.phase <= lang_mark_phase_enum
&& tree->type.node_class == etree_assign
- && tree->assign.hidden))
+ && tree->assign.defsym))
{
if (h == NULL)
{
@@ -1054,6 +1054,7 @@ static etree_type *
exp_assop (const char *dst,
etree_type *src,
enum node_tree_enum class,
+ bfd_boolean defsym,
bfd_boolean hidden)
{
etree_type *n;
@@ -1065,20 +1066,25 @@ exp_assop (const char *dst,
n->assign.type.node_class = class;
n->assign.src = src;
n->assign.dst = dst;
+ n->assign.defsym = defsym;
n->assign.hidden = hidden;
return n;
}
+/* Handle linker script assignments and HIDDEN. */
+
etree_type *
-exp_assign (const char *dst, etree_type *src)
+exp_assign (const char *dst, etree_type *src, bfd_boolean hidden)
{
- return exp_assop (dst, src, etree_assign, FALSE);
+ return exp_assop (dst, src, etree_assign, FALSE, hidden);
}
+/* Handle --defsym command-line option. */
+
etree_type *
exp_defsym (const char *dst, etree_type *src)
{
- return exp_assop (dst, src, etree_assign, TRUE);
+ return exp_assop (dst, src, etree_assign, TRUE, FALSE);
}
/* Handle PROVIDE. */
@@ -1086,7 +1092,7 @@ exp_defsym (const char *dst, etree_type *src)
etree_type *
exp_provide (const char *dst, etree_type *src, bfd_boolean hidden)
{
- return exp_assop (dst, src, etree_provide, hidden);
+ return exp_assop (dst, src, etree_provide, FALSE, hidden);
}
/* Handle ASSERT. */