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]

change behavior of elfos.h slightly


Hi folks...

I'm in the midst of rewriting the NetBSD GCC configurations, and am
trying to toss as much of the needless duplication in the header files
as possible.  I decided to use config/elfos.h to do this, but needed to
make a few small modifications.  I'm submitting this patch now so that
I can rethink my strategy if this one is rejected.  Changes are:

	ASM_OUTPUT_IDENT: undef before redefining, so as to override
	any definition which may have snuck in.

	LOCAL_LABEL_PREFIX: cause an error if this is not defined,
	as it is required for correct local labels to be generated.

	ASM_OUTPUT_INTERNAL_LABEL: use LOCAL_LABEL_PREFIX rather
	than assuming one of ".".

	ASM_GENERATE_INTERNAL_LABEL: Likewise.

The latter two are required in order to be able to use elfos.h on
e.g. MIPS and Alpha targets (assuming you want those targets to
continue to use the "$" as their local label prefix).

Note that I have not verified that other users of elfos.h still compile.

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>


Index: elfos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/elfos.h,v
retrieving revision 1.16
diff -c -r1.16 elfos.h
*** elfos.h	2000/04/12 00:29:43	1.16
--- elfos.h	2000/05/04 00:05:11
***************
*** 90,95 ****
--- 90,96 ----
  
  /* Output #ident as a .ident.  */
  
+ #undef  ASM_OUTPUT_IDENT
  #define ASM_OUTPUT_IDENT(FILE, NAME) \
    fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
  
***************
*** 115,120 ****
--- 116,128 ----
  #undef  SET_ASM_OP
  #define SET_ASM_OP	".set"
  
+ /* We require that the includer of this file has specified the correct
+    LOCAL_LABEL_PREFIX; it's used below.  */
+ 
+ #ifndef LOCAL_LABEL_PREFIX
+ #error LOCAL_LABEL_PREFIX not defined -- check configuration
+ #endif
+ 
  /* This is how to begin an assembly language file.  Most svr4 assemblers want
     at least a .file directive to come first, and some want to see a .version
     directive come right after that.  Here we just establish a default
***************
*** 142,152 ****
     with a period is not put into the linker symbol table by the assembler.  */
  
  #undef  ASM_OUTPUT_INTERNAL_LABEL
! #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM)	\
!   do							\
!     {							\
!       fprintf (FILE, ".%s%d:\n", PREFIX, NUM);		\
!     }							\
    while (0)
  
  /* This is how to store into the string LABEL
--- 150,160 ----
     with a period is not put into the linker symbol table by the assembler.  */
  
  #undef  ASM_OUTPUT_INTERNAL_LABEL
! #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM)			\
!   do									\
!     {									\
!       fprintf (FILE, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM);	\
!     }									\
    while (0)
  
  /* This is how to store into the string LABEL
***************
*** 161,167 ****
  #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)		\
    do								\
      {								\
!       sprintf (LABEL, "*.%s%d", PREFIX, (unsigned) (NUM));	\
      }								\
    while (0)
  
--- 169,176 ----
  #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)		\
    do								\
      {								\
!       sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX,	\
!                (unsigned) (NUM));				\
      }								\
    while (0)
  

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