This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)
 	{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]