]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - gcc/config/pa/pa-linux.h
Imported gcc-4.4.3
[msp430-gcc.git] / gcc / config / pa / pa-linux.h
index 3182495f68479204691b0a065bc43312a21ade8c..8af089a4dea69656c53b792e1143b9fcc9c04a42 100644 (file)
@@ -1,40 +1,41 @@
 /* Definitions for PA_RISC with ELF format
-   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
-/* Wide characters are signed.  */
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
 
-/* Use DWARF2 debugging info and unwind.  */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-#define DWARF2_ASM_LINE_DEBUG_INFO 1
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+       LINUX_TARGET_OS_CPP_BUILTINS();         \
+       builtin_assert ("machine=bigendian");   \
+    }                                          \
+  while (0)
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -D__gnu_linux__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian"
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
 
 #undef LIB_SPEC
 #define LIB_SPEC \
-  "%{shared: -lgcc -lc} \
-   %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
-       %{shared-libgcc: -lgcc} %{profile:-lc_p} %{!profile: -lc}}"
+  "%{pthread:-lpthread} \
+   %{shared:-lgcc -lc} \
+   %{!shared:%{mieee-fp:-lieee} %{shared-libgcc:-lgcc} %{profile:-lc_p}%{!profile:-lc}}"
 
 #undef ASM_SPEC
 #define ASM_SPEC \
@@ -43,29 +44,19 @@ Boston, MA 02111-1307, USA.  */
 /* Define this for shared library support because it isn't in the main
    linux.h file.  */
 
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
 #undef LINK_SPEC
 #define LINK_SPEC "\
   %{shared:-shared} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
-      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+      %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
       %{static:-static}}"
 
-/* Sibcalls are ok.  */
-#undef FUNCTION_OK_FOR_SIBCALL
-#define FUNCTION_OK_FOR_SIBCALL(x) 1
-
 /* glibc's profiling functions don't need gcc to allocate counters.  */
-#define NO_PROFILE_COUNTERS 1
-
-/* Put plabels into the data section so we can relocate them.  */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN)     \
-  if (flag_pic && function_label_operand (RTX, MODE))  \
-    data_section ();                                   \
-  else                                                 \
-    readonly_data_section ();
+#define NO_DEFERRED_PROFILE_COUNTERS 1
 
 /* Define the strings used for the special svr4 .type and .size directives.
    These strings generally do not vary from one system running svr4 to
@@ -74,47 +65,13 @@ Boston, MA 02111-1307, USA.  */
    file which includes this one.  */
 
 #undef STRING_ASM_OP
-#define STRING_ASM_OP   ".stringz"
+#define STRING_ASM_OP   "\t.stringz\t"
 
 #define TEXT_SECTION_ASM_OP "\t.text"
 #define DATA_SECTION_ASM_OP "\t.data"
 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
 
-/* Output at beginning of assembler file.  We override the definition
-   from <linux.h> so that we can get the proper .LEVEL directive.  */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-  do                                                           \
-    {                                                          \
-      if (write_symbols != NO_DEBUG)                           \
-       {                                                       \
-         output_file_directive (FILE, main_input_filename);    \
-         fputs ("\t.version\t\"01.01\"\n", FILE);              \
-       }                                                       \
-      if (TARGET_64BIT)                                                \
-       fputs("\t.LEVEL 2.0w\n", FILE);                         \
-      else if (TARGET_PA_20)                                   \
-       fputs("\t.LEVEL 2.0\n", FILE);                          \
-      else if (TARGET_PA_11)                                   \
-       fputs("\t.LEVEL 1.1\n", FILE);                          \
-      else                                                     \
-       fputs("\t.LEVEL 1.0\n", FILE);                          \
-      if (profile_flag)                                                \
-       fputs ("\t.IMPORT _mcount, CODE\n", FILE);              \
-    }                                                          \
-   while (0)
-
-/* Output a definition */
-#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
-  do                                                           \
-    {                                                          \
-      fprintf ((FILE), "\t%s\t", SET_ASM_OP);                  \
-      assemble_name (FILE, LABEL1);                            \
-      fprintf (FILE, ",");                                     \
-      assemble_name (FILE, LABEL2);                            \
-      fprintf (FILE, "\n");                                    \
-    }                                                          \
-  while (0)
+#define TARGET_ASM_FILE_START pa_linux_file_start
 
 /* We want local labels to start with period if made with asm_fprintf.  */
 #undef LOCAL_LABEL_PREFIX
@@ -129,36 +86,31 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_OUTPUT_ADDR_VEC_ELT
 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
   if (TARGET_BIG_SWITCH)                                       \
-    fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE);             \
+    fprintf (FILE, "\t.word .L%d\n", VALUE);                   \
   else                                                         \
     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
 
 #undef ASM_OUTPUT_ADDR_DIFF_ELT
 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
   if (TARGET_BIG_SWITCH)                                       \
-    fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE);                                \
+    fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL);         \
   else                                                         \
     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
 
-/* This is how to output the definition of a user-level label named NAME,
-   such as the label on a static function or variable NAME.  */
-
+/* Use the default.  */
 #undef ASM_OUTPUT_LABEL
-#define ASM_OUTPUT_LABEL(FILE, NAME) \
-  do                                                           \
-    {                                                          \
-      assemble_name (FILE, NAME);                              \
-      fputs (":\n", FILE);                                     \
-    }                                                          \
-  while (0)
 
-/* NOTE: ASM_OUTPUT_INTERNAL_LABEL() is defined for us by elfos.h, and
+/* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
    does what we want (i.e. uses colons).  It must be compatible with
    ASM_GENERATE_INTERNAL_LABEL(), so do not define it here.  */
 
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
-  (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
+/* Use the default.  */
+#undef ASM_OUTPUT_INTERNAL_LABEL
+
+/* Use the default.  */
+#undef TARGET_ASM_GLOBALIZE_LABEL
+/* Globalizing directive for a label.  */
+#define GLOBAL_ASM_OP ".globl "
 
 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
    labels in a function declaration (since pa.c seems determined to do
@@ -168,15 +120,24 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)            \
   do                                                           \
     {                                                          \
-      fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                  \
-      assemble_name (FILE, NAME);                              \
-      putc (',', FILE);                                                \
-      fprintf (FILE, TYPE_OPERAND_FMT, "function");            \
-      putc ('\n', FILE);                                       \
+      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");      \
       ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));           \
     }                                                          \
   while (0)
 
+/* As well as globalizing the label, we need to encode the label
+   to ensure a plabel is generated in an indirect call.  */
+
+#undef ASM_OUTPUT_EXTERNAL_LIBCALL
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)                 \
+  do                                                           \
+    {                                                          \
+      if (!FUNCTION_NAME_P (XSTR (FUN, 0)))                    \
+       hppa_encode_label (FUN);                                \
+      (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));        \
+    }                                                          \
+  while (0)
+
 /* Linux always uses gas.  */
 #undef TARGET_GAS
 #define TARGET_GAS 1