aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Change non-PowerPC and AIX64 combination to...
authorDavid Edelsohn <edelsohn@gnu.org>
Mon, 3 May 1999 20:10:06 +0000 (20:10 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Mon, 3 May 1999 20:10:06 +0000 (16:10 -0400)
        * rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Change non-PowerPC
        and AIX64 combination to warning.  Add warning for disabling
        PowerPC64 support when using 64-bit mode.
        (LIB_SPEC): Do not link with libg.a in 64-bit mode.
        (LINK_SPEC): Do not export libg.exp symbols in 64-bit mode.
        * rs6000/rs6000.h (MY_ISCOFF): Treat import/export files as valid
        XCOFF files.
        (read_only_data_section, private_data_section,
        read_only_private_data_section): Always align CSECTs to doubleword
        boundary regardless of mode.
        (TEXT_SECTION_ASM_OP): Align text CSECT on doubleword boundary in
        64-bit mode.
        (DATA_SECTION_ASM_OP): Always align CSECT to doubleword boundary.
        (ASM_OUTPUT_LOCAL): Use rounded size in 64-bit mode to
        maintain doublword alignment.

From-SVN: r26762

gcc/ChangeLog
gcc/config/rs6000/aix43.h
gcc/config/rs6000/rs6000.h

index badca35b64a3ef3a6479b59d589a8564f95a808c..68dd128a47daa53abf6ce56d66ed9a4065ab68ef 100644 (file)
@@ -1,3 +1,21 @@
+Mon May  3 22:38:41 1999  David Edelsohn  <edelsohn@gnu.org>
+
+       * rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Change non-PowerPC
+       and AIX64 combination to warning.  Add warning for disabling
+       PowerPC64 support when using 64-bit mode.
+       (LIB_SPEC): Do not link with libg.a in 64-bit mode.
+       (LINK_SPEC): Do not export libg.exp symbols in 64-bit mode.
+       * rs6000/rs6000.h (MY_ISCOFF): Treat import/export files as valid
+       XCOFF files.
+       (read_only_data_section, private_data_section,
+       read_only_private_data_section): Always align CSECTs to doubleword
+       boundary regardless of mode.
+       (TEXT_SECTION_ASM_OP): Align text CSECT on doubleword boundary in
+       64-bit mode.
+       (DATA_SECTION_ASM_OP): Always align CSECT to doubleword boundary.
+       (ASM_OUTPUT_LOCAL): Use rounded size in 64-bit mode to
+       maintain doublword alignment.
+
 Mon May  3 14:45:23 1999  Jeffrey A Law  (law@cygnus.com)
 
        * mn10200.md (btst insns): btst does not leave cc0 in a useable
index 7d9041aa80f1f337005b29e60a4c0d122bbda2d3..7814f6b9c6495c19ffa88b3dea98465ac4deb8df 100644 (file)
@@ -48,7 +48,12 @@ do {                                                                 \
   if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS))              \
     {                                                                  \
       target_flags &= ~NON_POWERPC_MASKS;                              \
-      error ("-maix64 and POWER architecture are incompatible.");      \
+      warning ("-maix64 and POWER architecture are incompatible.");    \
+    }                                                                  \
+  if (TARGET_64BIT && ! (target_flags & MASK_POWERPC64))               \
+    {                                                                  \
+      target_flags |= MASK_POWERPC64;                                  \
+      warning ("-maix64 requires PowerPC64 architecture remain enabled."); \
     }                                                                  \
 } while (0);
 
@@ -172,14 +177,15 @@ do {                                                                      \
 
 #undef LIB_SPEC
 #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
-   %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}}\
+   %{p:-L/lib/profiled -L/usr/lib/profiled}\
+   %{!maix64:%{!shared:%{g*:-lg}}}\
    %{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
-   %{mthreads: -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a}\
-   %{!mthreads: -lc}"
+   %{mthreads:-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a}\
+   %{!mthreads:-lc}"
 
 #undef LINK_SPEC
 #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
-   %{static:-bnso %(link_syscalls) } %{!shared: %{g*: %(link_libg) }}\
+   %{static:-bnso %(link_syscalls) } %{!maix64:%{!shared:%{g*: %(link_libg) }}}\
    %{shared:-bM:SRE %{!e:-bnoentry}} %{maix64:-b64}"
 
 #undef STARTFILE_SPEC
index 4aa720808c381d4d4b7fc3b909923bb7007a8a67..527daf0df3053779d866daf25c61d88e7d293266 100644 (file)
@@ -2215,12 +2215,16 @@ do {                                                                    \
 #define OBJECT_FORMAT_COFF
 
 /* Define the magic numbers that we recognize as COFF.
+
    AIX 4.3 adds U803XTOCMAGIC (0757) for 64-bit objects, but collect2.c
    does not include files in the correct order to conditionally define
-   the symbolic name in this macro.  */
+   the symbolic name in this macro. 
+
+   The AIX linker accepts import/export files as object files,
+   so accept "#!" (0x2321) magic number.  */
 #define MY_ISCOFF(magic) \
   ((magic) == U802WRMAGIC || (magic) == U802ROMAGIC \
-   || (magic) == U802TOCMAGIC || (magic) == 0757)
+   || (magic) == U802TOCMAGIC || (magic) == 0757 || (magic) == 0x2321)
 
 /* This is the only version of nm that collect2 can work with.  */
 #define REAL_NM_FILE_NAME "/usr/ucb/nm"
@@ -2542,7 +2546,8 @@ extern int rs6000_trunc_used;
 
 #define JUMP_TABLES_IN_TEXT_SECTION 1
 
-/* Define the routines to implement these extra sections.  */
+/* Define the routines to implement these extra sections.
+   BIGGEST_ALIGNMENT is 64, so align the sections that much.  */
 
 #define EXTRA_SECTION_FUNCTIONS                                \
                                                        \
@@ -2551,9 +2556,8 @@ read_only_data_section ()                         \
 {                                                      \
   if (in_section != read_only_data)                    \
     {                                                  \
-      fprintf (asm_out_file, ".csect %s[RO]%s\n",      \
-              xcoff_read_only_section_name,            \
-              (TARGET_32BIT ? "" : ",3"));             \
+      fprintf (asm_out_file, ".csect %s[RO],3\n",      \
+              xcoff_read_only_section_name);           \
       in_section = read_only_data;                     \
     }                                                  \
 }                                                      \
@@ -2563,9 +2567,8 @@ private_data_section ()                                   \
 {                                                      \
   if (in_section != private_data)                      \
     {                                                  \
-      fprintf (asm_out_file, ".csect %s[RW]%s\n",      \
-              xcoff_private_data_section_name,         \
-              (TARGET_32BIT ? "" : ",3"));             \
+      fprintf (asm_out_file, ".csect %s[RW],3\n",      \
+              xcoff_private_data_section_name);        \
       in_section = private_data;                       \
     }                                                  \
 }                                                      \
@@ -2575,9 +2578,8 @@ read_only_private_data_section ()                 \
 {                                                      \
   if (in_section != read_only_private_data)            \
     {                                                  \
-      fprintf (asm_out_file, ".csect %s[RO]%s\n",      \
-              xcoff_private_data_section_name,         \
-              (TARGET_32BIT ? "" : ",3"));             \
+      fprintf (asm_out_file, ".csect %s[RO],3\n",      \
+              xcoff_private_data_section_name);        \
       in_section = read_only_private_data;             \
     }                                                  \
 }                                                      \
@@ -2806,14 +2808,16 @@ extern int toc_initialized;
 
 #define ASM_APP_OFF ""
 
-/* Output before instructions.  */
+/* Output before instructions.
+   Text section for 64-bit target may contain 64-bit address jump table.  */
 
-#define TEXT_SECTION_ASM_OP ".csect .text[PR]"
+#define TEXT_SECTION_ASM_OP (TARGET_32BIT \
+                            ? ".csect .text[PR]" : ".csect .text[PR],3")
 
-/* Output before writable data.  */
+/* Output before writable data.
+   Align entire section to BIGGEST_ALIGNMENT.  */
 
-#define DATA_SECTION_ASM_OP (TARGET_32BIT \
-                            ? ".csect .data[RW]" : ".csect .data[RW],3")
+#define DATA_SECTION_ASM_OP ".csect .data[RW],3"
 
 /* How to refer to registers in assembler output.
    This sequence is indexed by compiler's hard-register-number (see above).  */
@@ -3116,12 +3120,16 @@ do {                                                                    \
   } while (0)
 
 /* This says how to output an assembler line
-   to define a local common symbol.  */
+   to define a local common symbol.
+   Alignment cannot be specified, but we can try to maintain
+   alignment after preceding TOC section if it was aligned
+   for 64-bit mode.  */
 
-#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED)     \
+#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)    \
   do { fputs (".lcomm ", (FILE));                      \
        RS6000_OUTPUT_BASENAME ((FILE), (NAME));                \
-       fprintf ((FILE), ",%d,%s\n", (SIZE), xcoff_bss_section_name); \
+       fprintf ((FILE), ",%d,%s\n", (TARGET_32BIT ? (SIZE) : (ROUNDED)), \
+               xcoff_bss_section_name);                \
      } while (0)
 
 /* Store in OUTPUT a string (made with alloca) containing