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]

Re: SYMBOL_REF_FLAG


On Fri, Sep 13, 2002 at 10:19:45PM -0400, David Edelsohn wrote:
> 	Yes, this should be changed in all locations.

OK here we go.

	* config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Use
	targetm.binds_local_p to set SYMBOL_REF_FLAG.
	(rs6000_xcoff_encode_section_info): Likewise.
	(config/rs6000/xcoff.h): Likewise.

OK mainline?  This should probably also be fixed on the gcc-3.2 branch,
and the flag_pic issue too.  Alternatively, if that is too large a fix
for the branch to risk destabilizing rs6000-aix gcc, I can continue
putting such fixes in a patcheset for powerpc64-linux.

Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.377
diff -u -p -r1.377 rs6000.c
--- gcc/config/rs6000/rs6000.c	13 Sep 2002 01:40:43 -0000	1.377
+++ gcc/config/rs6000/rs6000.c	14 Sep 2002 02:35:27 -0000
@@ -12424,8 +12424,7 @@ rs6000_elf_encode_section_info (decl, fi
   if (TREE_CODE (decl) == FUNCTION_DECL)
     {
       rtx sym_ref = XEXP (DECL_RTL (decl), 0);
-      if ((TREE_ASM_WRITTEN (decl) || ! TREE_PUBLIC (decl))
-          && ! DECL_WEAK (decl))
+      if ((*targetm.binds_local_p) (decl))
 	SYMBOL_REF_FLAG (sym_ref) = 1;
 
       if (DEFAULT_ABI == ABI_AIX)
@@ -13121,8 +13120,7 @@ rs6000_xcoff_encode_section_info (decl, 
      int first ATTRIBUTE_UNUSED;
 {
   if (TREE_CODE (decl) == FUNCTION_DECL
-      && (TREE_ASM_WRITTEN (decl) || ! TREE_PUBLIC (decl))
-      && ! DECL_WEAK (decl))
+      && (*targetm.binds_local_p) (decl))
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
 }
 
Index: gcc/config/rs6000/xcoff.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/xcoff.h,v
retrieving revision 1.36
diff -u -p -r1.36 xcoff.h
--- gcc/config/rs6000/xcoff.h	11 Sep 2002 17:36:06 -0000	1.36
+++ gcc/config/rs6000/xcoff.h	14 Sep 2002 02:47:20 -0000
@@ -266,7 +266,7 @@ toc_section ()						\
 
 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL)		\
 { rtx sym_ref = XEXP (DECL_RTL (DECL), 0);			\
-  if (!DECL_WEAK (DECL))					\
+  if ((*targetm.binds_local_p) (DECL))				\
     SYMBOL_REF_FLAG (sym_ref) = 1;				\
   if (TREE_PUBLIC (DECL))					\
     {								\

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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