This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: Fix MeP support for weak symbols
- From: Nick Clifton <nickc at redhat dot com>
- To: dj at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Sep 2009 09:19:44 +0100
- Subject: RFA: Fix MeP support for weak symbols
Hi DJ,
Currently the MeP toolchain has a problem with weak symbols - that
being that if it renames the symbol to add section information, it
looses the weakness attribute. The patch below fixes this by adding
the necessary assignments.
OK to apply ?
Cheers
Nick
gcc/ChangeLog
2009-09-10 Nick Clifton <nickc@redhat.com>
* config/mep/mep.c (mep_encode_section_info): Copy weakness
attribute and referring decl when creating renamed symbol.
Index: gcc/config/mep/mep.c
===================================================================
--- gcc/config/mep/mep.c (revision 151554)
+++ gcc/config/mep/mep.c (working copy)
@@ -4564,6 +4564,8 @@
idp = get_identifier (newname);
XEXP (rtl, 0) =
gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
+ SYMBOL_REF_WEAK (XEXP (rtl, 0)) = DECL_WEAK (decl);
+ SET_SYMBOL_REF_DECL (XEXP (rtl, 0), decl);
switch (encoding)
{