This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ARM: Add support for generating .p2align directives


Hi Guys,

  I am applying the following patch to the ARM port which will aloow
  it to generate .p2align directives, if the assembler supports them.

  This will help the ARM port support the -falign-xxxx command line
  switches, since the spaces introduced by the alignments need to be
  filled with no-op instructions, not zeroes.  The normal .align
  directive will not do this, but the .p2align directive will
  (provided that a recent patch to GAS for the ARM has been applied).

Cheers
        Nick

2001-04-26  Nick Clifton  <nickc@cambridge.redhat.com>

	* config/arm/arm.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define, if the
	assembler supports .p2align.

Index: config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.99
diff -p -r1.99 arm.h
*** arm.h	2001/04/08 19:55:04	1.99
--- arm.h	2001/04/26 15:24:20
*************** extern int making_const_table;
*** 2704,2709 ****
--- 2704,2724 ----
      }								\
    while (0)
  
+ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+ /* To support -falign-* switches we need to use .p2align so
+    that alignment directives in code sections will be padded
+    with no-op instructions, rather than zeroes.  */
+ #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)		\
+   if ((LOG) != 0)						\
+     {								\
+       if ((MAX_SKIP) == 0)					\
+         fprintf ((FILE), "\t.p2align %d\n", (LOG));		\
+       else							\
+         fprintf ((FILE), "\t.p2align %d,,%d\n",			\
+                  (LOG), (MAX_SKIP));				\
+     }
+ #endif
+ 
  /* Target characters.  */
  #define TARGET_BELL	007
  #define TARGET_BS	010


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]