]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aix: align text CSECTs to at least 32 bytes.
authorDavid Edelsohn <dje.gcc@gmail.com>
Wed, 12 May 2021 01:07:19 +0000 (21:07 -0400)
committerDavid Edelsohn <dje.gcc@gmail.com>
Wed, 30 Jun 2021 00:44:12 +0000 (20:44 -0400)
gcc/ChangeLog:

* config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags):
Increase code CSECT alignment to at least 32 bytes.
* config/rs6000/xcoff.h (TEXT_SECTION_ASM_OP): Add 32 byte
alignment designation.

gcc/config/rs6000/rs6000.c
gcc/config/rs6000/xcoff.h

index 2c249e186e1e28c5bdb87f3d628b2c619f9512d1..075c156ae13c2513fd2d14834f5a349a4edda029 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
 /* Subroutines used for code generation on IBM RS/6000.
    Copyright (C) 1991-2021 Free Software Foundation, Inc.
    Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -21361,8 +21362,11 @@ rs6000_xcoff_section_type_flags (tree decl, const char *name, int reloc)
     flags |= SECTION_BSS;
 
   /* Align to at least UNIT size.  */
-  if ((flags & SECTION_CODE) != 0 || !decl || !DECL_P (decl))
+  if (!decl || !DECL_P (decl))
     align = MIN_UNITS_PER_WORD;
+  /* Align code CSECT to at least 32 bytes.  */
+  else if ((flags & SECTION_CODE) != 0)
+    align = MAX ((DECL_ALIGN (decl) / BITS_PER_UNIT), 32);
   else
     /* Increase alignment of large objects if not already stricter.  */
     align = MAX ((DECL_ALIGN (decl) / BITS_PER_UNIT),
index 5ba565f63bb93e7197f3cb6dd2050c3e690dc2fd..f3546fadf3390af433dc909dbce1323dcd89d6a9 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
 /* Definitions of target machine for GNU compiler,
    for some generic XCOFF file format
    Copyright (C) 2001-2021 Free Software Foundation, Inc.
 #define DOUBLE_INT_ASM_OP "\t.llong\t"
 
 /* Output before instructions.  */
-#define TEXT_SECTION_ASM_OP "\t.csect .text[PR]"
+#define TEXT_SECTION_ASM_OP "\t.csect .text[PR],5"
 
 /* Output before writable data.  */
 #define DATA_SECTION_ASM_OP \