OSDN Git Service

* doc/invoke.texi: Add mcmodel to powerpc options.
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / linux64.h
index 39d440a..d787d29 100644 (file)
@@ -63,6 +63,16 @@ extern int dot_symbols;
 
 #define TARGET_PROFILE_KERNEL profile_kernel
 
+#define TARGET_USES_LINUX64_OPT 1
+#ifdef HAVE_LD_LARGE_TOC
+extern enum rs6000_cmodel cmodel;
+#undef TARGET_CMODEL
+#define TARGET_CMODEL cmodel
+#define SET_CMODEL(opt) cmodel = opt
+#else
+#define SET_CMODEL(opt)
+#endif
+
 #undef  PROCESSOR_DEFAULT
 #define PROCESSOR_DEFAULT PROCESSOR_POWER6
 #undef  PROCESSOR_DEFAULT64
@@ -114,6 +124,23 @@ extern int dot_symbols;
              target_flags |= MASK_POWERPC64;                   \
              error ("-m64 requires a PowerPC64 cpu");          \
            }                                                   \
+         if ((target_flags_explicit & MASK_MINIMAL_TOC) != 0)  \
+           {                                                   \
+             if (rs6000_explicit_options.cmodel                \
+                 && cmodel != CMODEL_SMALL)                    \
+               error ("-mcmodel incompatible with other toc options"); \
+             SET_CMODEL (CMODEL_SMALL);                        \
+           }                                                   \
+         else                                                  \
+           {                                                   \
+             if (!rs6000_explicit_options.cmodel)              \
+               SET_CMODEL (CMODEL_MEDIUM);                     \
+             if (cmodel != CMODEL_SMALL)                       \
+               {                                               \
+                 TARGET_NO_FP_IN_TOC = 0;                      \
+                 TARGET_NO_SUM_IN_TOC = 0;                     \
+               }                                               \
+           }                                                   \
        }                                                       \
       else                                                     \
        {                                                       \
@@ -124,6 +151,11 @@ extern int dot_symbols;
              TARGET_PROFILE_KERNEL = 0;                        \
              error (INVALID_32BIT, "profile-kernel");          \
            }                                                   \
+         if (rs6000_explicit_options.cmodel)                   \
+           {                                                   \
+             SET_CMODEL (CMODEL_SMALL);                        \
+             error (INVALID_32BIT, "cmodel");                  \
+           }                                                   \
        }                                                       \
     }                                                          \
   while (0)