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]

-fleading-underscore fix for elf targets



This fixes a problem with -fleading-underscore on m68k/elf, and lots
of other places; it also makes -fno-leading-underscore work on sh-elf.
Tested on sparc-solaris and sh-elf.

The basic idea is that it's never right to specify ASM_OUTPUT_LABELREF
without using %U, because the user can change %U.  It may be silly
for the user to specify -fno-leading-underscores if that's not the
default, but it's allowed and might occasionally be useful.  It's
always valid to specify -fleading-underscores; that's just like
putting an underscore in front of identifiers in the source.

OK to commit?

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~geoffk/patches/cygnus/gcc-102725-2.patch===========
2000-02-25  Geoff Keating  <geoffk@cygnus.com>

	* config/elfos.h (ASM_OUTPUT_LABELREF): Don't define.  The default
	is right for most ELF targets.
	* config/ns32k/ns32k.h (ASM_OUTPUT_LABELREF): Don't define.
	Let the default file use %U properly.
	* config/sh/elf.h (ASM_OUTPUT_LABELREF): Don't define.  Use the
	default.

Index: gcc/config/elfos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/elfos.h,v
retrieving revision 1.14
diff -p -u -u -p -r1.14 elfos.h
--- elfos.h	2000/01/22 19:49:21	1.14
+++ elfos.h	2000/02/25 20:17:52
@@ -84,15 +84,6 @@ Boston, MA 02111-1307, USA.  */
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 #endif
 
-/* This is how to output a reference to a user-level label named NAME.
-   `assemble_name' uses this.
-
-   For most ELF systems the convention is *not* to prepend a leading
-   underscore onto user-level symbol names.  */
-
-#undef  ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "%s", NAME)
-     
 /* All SVR4 targets use the ELF object file format.  */
 #define OBJECT_FORMAT_ELF
 
Index: gcc/config/ns32k/ns32k.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ns32k/ns32k.h,v
retrieving revision 1.11
diff -p -u -u -p -r1.11 ns32k.h
--- ns32k.h	2000/01/27 19:20:51	1.11
+++ ns32k.h	2000/02/25 20:17:52
@@ -1590,12 +1590,6 @@ do {									\
 } while (0)
 #endif
 
-/* This is how to output a reference to a user-level label named NAME.
-   `assemble_name' uses this.  */
-
-#define ASM_OUTPUT_LABELREF(FILE,NAME)	\
-  fprintf (FILE, "_%s", NAME)
-
 /* This is how to output an internal numbered label where
    PREFIX is the class of label and NUM is the number within the class.  */
 
Index: gcc/config/sh/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/elf.h,v
retrieving revision 1.6
diff -p -u -u -p -r1.6 elf.h
--- elf.h	2000/01/14 16:28:59	1.6
+++ elf.h	2000/02/25 20:17:53
@@ -1,5 +1,5 @@
 /* Definitions of target machine for gcc for Hitachi Super-H using ELF.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
    Contributed by Ian Lance Taylor <ian@cygnus.com>.
 
 This file is part of GNU CC.
@@ -75,12 +75,6 @@ Boston, MA 02111-1307, USA.  */
    again.  */
 #define DBX_REGISTER_NUMBER(REGNO)	\
   (((REGNO) >= 22 && (REGNO) <= 39) ? ((REGNO) + 1) : (REGNO))
-
-/* SH ELF, unlike most ELF implementations, uses underscores before
-   symbol names.  */
-#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(STREAM,NAME) \
-  asm_fprintf (STREAM, "%U%s", NAME)
 
 #undef ASM_GENERATE_INTERNAL_LABEL
 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
============================================================

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