]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
elf.h (PREFERRED_DEBUGGING_TYPE): Undefine before including svr4.h.
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Tue, 25 Nov 1997 23:53:32 +0000 (23:53 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 25 Nov 1997 23:53:32 +0000 (16:53 -0700)
        * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Undefine before including
        svr4.h.

        * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Don't redefine.

        * sh/elf.h (HANDLE_SYSV_PRAGMA): Undefine.

        * sh/elf.h: (LINK_SPEC): Use shlelf.
        (USER_LABEL_PREFIX, LOCAL_LABEL_PREFIX, ASM_FILE_START): Redefine.

        * sh.h: dwarf patches from Fred Fish.

From-SVN: r16717

gcc/ChangeLog
gcc/config/sh/elf.h
gcc/config/sh/sh.h

index 2d8cacd1e02ff6697ac991642058ff958365d1da..d05260872e6a004dbadf6cba785542840cd973cc 100644 (file)
@@ -1,5 +1,17 @@
 Tue Nov 25 10:00:42 1997  J"orn Rennecke <amylaar@cygnus.co.uk>
 
+       * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Undefine before including
+       svr4.h.
+
+       * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Don't redefine.
+
+       * sh/elf.h (HANDLE_SYSV_PRAGMA): Undefine.
+
+       * sh/elf.h: (LINK_SPEC): Use shlelf.
+       (USER_LABEL_PREFIX, LOCAL_LABEL_PREFIX, ASM_FILE_START): Redefine.
+
+       * sh.h: dwarf patches from Fred Fish.
+
        * va-sh.h (__va_arg_sh1): Define.
        (va_arg): Use it.
        SH3E doesn't use any integer registers for subsequent arguments
index 2c3294b493531677ac1dd24138bd2d1d805869e6..a56077e544ea7eb8b8b71412bda5f5c65ab58fa0 100644 (file)
@@ -25,10 +25,6 @@ Boston, MA 02111-1307, USA.  */
 /* No SDB debugging info.  */
 #undef SDB_DEBUGGING_INFO
 
-/* Prefer stabs.  */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
 /* Undefine some macros defined in both sh.h and svr4.h.  */
 #undef IDENT_ASM_OP
 #undef ASM_FILE_END
@@ -40,10 +36,30 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_OUTPUT_CONSTRUCTOR
 #undef ASM_OUTPUT_DESTRUCTOR
 #undef ASM_DECLARE_FUNCTION_NAME
+#undef PREFERRED_DEBUGGING_TYPE
 
 /* Be ELF-like.  */
 #include "svr4.h"
 
+/* The prefix to add to user-visible assembler symbols.
+   Note that svr4.h redefined it from the original value (that we want)
+   in sh.h */
+
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX "_"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) do {                              \
+  output_file_directive ((FILE), main_input_filename);         \
+  if (TARGET_LITTLE_ENDIAN)                                    \
+    fprintf ((FILE), "\t.little\n");                           \
+} while (0)
+
+
+
 /* Let code know that this is ELF.  */
 #define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Acpu(sh) -Amachine(sh)"
 
@@ -52,7 +68,7 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_SPEC  "%{ml:-little} %{mrelax:-relax}"
 
 #undef LINK_SPEC
-#define LINK_SPEC "%{ml:-m shl} %{mrelax:-relax}"
+#define LINK_SPEC "%{ml:-m shlelf} %{mrelax:-relax}"
 
 /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
    again.  */
@@ -63,29 +79,26 @@ Boston, MA 02111-1307, USA.  */
    symbol names.  */
 #undef ASM_OUTPUT_LABELREF
 #define ASM_OUTPUT_LABELREF(STREAM,NAME) \
-  fprintf (STREAM, "_%s", NAME)
-
-/* Because SH ELF uses underscores, we don't put a '.' before local
-   labels, for easy compatibility with the COFF implementation.  */
+  asm_fprintf (STREAM, "%U%s", NAME)
 
 #undef ASM_GENERATE_INTERNAL_LABEL
 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
-  sprintf (STRING, "*%s%d", PREFIX, NUM)
+  sprintf ((STRING), "*%s%s%d", LOCAL_LABEL_PREFIX, (PREFIX), (NUM))
 
 #undef ASM_OUTPUT_INTERNAL_LABEL
 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
-  fprintf (FILE, "%s%d:\n", PREFIX, NUM)
+  asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
 
 #undef  ASM_OUTPUT_SOURCE_LINE
 #define ASM_OUTPUT_SOURCE_LINE(file, line)                             \
 do                                                                     \
   {                                                                    \
     static int sym_lineno = 1;                                         \
-    fprintf (file, ".stabn 68,0,%d,LM%d-",                             \
-            line, sym_lineno);                                         \
-    assemble_name (file,                                               \
+    asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-",                     \
+            (line), sym_lineno);                                       \
+    assemble_name ((file),                                             \
                   XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
-    fprintf (file, "\nLM%d:\n", sym_lineno);                           \
+    asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno);                   \
     sym_lineno += 1;                                                   \
   }                                                                    \
 while (0)
@@ -94,7 +107,7 @@ while (0)
 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME)                        \
 do {                                                                   \
   text_section ();                                                     \
-  fprintf (FILE, "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO);      \
+  fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO);    \
 } while (0)
 
 /* Arrange to call __main, rather than using crtbegin.o and crtend.o
@@ -103,3 +116,7 @@ do {                                                                        \
 #undef FINI_SECTION_ASM_OP
 #undef STARTFILE_SPEC
 #undef ENDFILE_SPEC
+
+/* HANDLE_SYSV_PRAGMA (defined by svr4.h) takes precedence over HANDLE_PRAGMA.
+   We want to use the HANDLE_PRAGMA from sh.h.  */
+#undef HANDLE_SYSV_PRAGMA
index 2c91182be17bf7dc725829e062b673ba274b5d4d..474a557abcbb4dcfcdc8a0882474c8c4655a695a 100644 (file)
@@ -1494,9 +1494,9 @@ dtors_section()                                                   \
 
 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,VALUE,REL)                     \
   if (TARGET_BIGTABLE)                                                         \
-    fprintf (STREAM, "\t.long  L%d-L%d\n", VALUE,REL);                 \
+    asm_fprintf ((STREAM), "\t.long\t%LL%d-%LL%d\n", (VALUE),(REL));   \
   else                                                                 \
-    fprintf (STREAM, "\t.word  L%d-L%d\n", VALUE,REL);                 \
+    asm_fprintf ((STREAM), "\t.word\t%LL%d-%LL%d\n", (VALUE),(REL));   \
 
 /* Output an absolute table element.  */