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]

powerpc64 stabs fix.


-gstabs+ on powerpc64-linux causes the assembler to complain, eg.
/tmp/ccRfbYgd.s:133: Error: subtraction of two symbols in different 
sections `.text' {.text section} - `main' {.opd section} at file
address 0000000000000230

I missed this case when fixing a similar -gstabs problem.

	* doc/tm.texi (DBX_OUTPUT_NFUN): Describe.
	* dbxout.c (dbxout_function_end): Use DBX_OUTPUT_NFUN.
	* config/rs6000/linux64.h (DBX_OUTPUT_NFUN): Define.

OK to apply?

Incidentally, DBX_OUTPUT_FUNCTION_END seems to be unused.  I'll happily
remove it too if requested.
./gcc/config/d30v/d30v.h:/* #define DBX_OUTPUT_FUNCTION_END(STREAM, FUNCTION) */
./gcc/config/stormy16/stormy16.h:/* #define DBX_OUTPUT_FUNCTION_END(STREAM, FUNCTION) */
./gcc/dbxout.c:#ifdef DBX_OUTPUT_FUNCTION_END
./gcc/dbxout.c:  DBX_OUTPUT_FUNCTION_END (asmfile, decl);
./gcc/doc/tm.texi:@findex DBX_OUTPUT_FUNCTION_END
./gcc/doc/tm.texi:@item DBX_OUTPUT_FUNCTION_END (@var{stream}, @var{function})

Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.165
diff -u -p -r1.165 tm.texi
--- doc/tm.texi	9 Sep 2002 20:04:32 -0000	1.165
+++ doc/tm.texi	13 Sep 2002 13:03:38 -0000
@@ -7841,6 +7841,11 @@ argument @var{name} is the name of an as
 @item DBX_OUTPUT_RBRAC (@var{stream}, @var{name})
 Like @code{DBX_OUTPUT_LBRAC}, but for the end of a scope level.
 
+@findex DBX_OUTPUT_NFUN
+@item DBX_OUTPUT_NFUN (@var{stream}, @var{lscope_label}, @var{decl})
+Define this macro if the target machine requires special handling to
+output an @code{N_FUN} entry for the function @var{decl}.
+
 @findex DBX_OUTPUT_ENUM
 @item DBX_OUTPUT_ENUM (@var{stream}, @var{type})
 Define this macro if the target machine requires special handling to
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.124
diff -u -p -r1.124 dbxout.c
--- dbxout.c	15 Aug 2002 19:59:28 -0000	1.124
+++ dbxout.c	13 Sep 2002 13:03:41 -0000
@@ -397,11 +397,15 @@ dbxout_function_end ()
 
   /* By convention, GCC will mark the end of a function with an N_FUN
      symbol and an empty string.  */
+#ifdef DBX_OUTPUT_NFUN
+  DBX_OUTPUT_NFUN (asmfile, lscope_label_name, current_function_decl);
+#else
   fprintf (asmfile, "%s\"\",%d,0,0,", ASM_STABS_OP, N_FUN);
   assemble_name (asmfile, lscope_label_name);
   putc ('-', asmfile);
   assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
   fprintf (asmfile, "\n");
+#endif
 }
 #endif /* DBX_DEBUGGING_INFO */
 
Index: config/rs6000/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux64.h,v
retrieving revision 1.27
diff -u -p -r1.27 linux64.h
--- config/rs6000/linux64.h	7 Sep 2002 00:37:49 -0000	1.27
+++ config/rs6000/linux64.h	13 Sep 2002 13:03:41 -0000
@@ -353,6 +353,18 @@ while (0)
 
 #define DBX_OUTPUT_LBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_LBRAC)
 #define DBX_OUTPUT_RBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_RBRAC)
+
+/* Another case where we want the dot name.  */
+#define DBX_OUTPUT_NFUN(FILE, LSCOPE, DECL)				\
+  do									\
+    {									\
+      fprintf (FILE, "%s\"\",%d,0,0,", ASM_STABS_OP, N_FUN);		\
+      assemble_name (FILE, LSCOPE);					\
+      fputs ("-.", FILE);						\
+      assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0));	\
+      putc ('\n', FILE);						\
+    }									\
+  while (0)
 
 /* Override sysv4.h as these are ABI_V4 only.  */
 #undef	ASM_OUTPUT_REG_PUSH

-- 
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]