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]

Re: Prevent arm-elf gcc from emiting ".align 0" directives


Hi Nick,

I see how this prevents align 0 from being emitted, but I fail to see how
these macros can be used to force byte alignment now.  Am I missing
something?

Scott

----- Original Message -----
From: Nick Clifton <nickc@cygnus.com>
To: <gcc-patches@gcc.gnu.org>
Sent: Wednesday, February 16, 2000 9:04 PM
Subject: Prevent arm-elf gcc from emiting ".align 0" directives


> Hi Guys,
>
>   Unless there are any objections I am about to apply this patch to
>   prevent the arm-elf and thumb-elf targeted versions of gcc froming
>   emitting ".align 0" directives when trying to emit byte aligned data
>   items.  This is because the ARM assemblers treat ".align 0"  as
>   indicating word alignment, nit byte alignment.
>
> Cheers
> Nick
>
> 2000-02-16  Nick Clifton  <nickc@cygnus.com>
>
> * config/arm/elf.h (ASM_OUTPUT_ALIGN): Do not generate
> anything for an alignment of zero.
>
> * config/arm/thumb.h (ASM_OUTPUT_ALIGN): Do not generate
> anything for an alignment of zero.
>
> Index: elf.h
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gcc/config/arm/elf.h,v
> retrieving revision 1.28
> diff -p -r1.28 elf.h
> *** elf.h 1999/11/05 09:34:49 1.28
> --- elf.h 2000/02/17 01:53:06
> *************** dtors_section () \
> *** 358,364 ****
>   #define MAX_OFILE_ALIGNMENT (32768 * 8)
>
>   /* Align output to a power of two.  */
> ! #define ASM_OUTPUT_ALIGN(STREAM, POWER)  \
> !   fprintf (STREAM, "\t.align\t%d\n", POWER)
>
>   #include "arm/aout.h"
> --- 358,369 ----
>   #define MAX_OFILE_ALIGNMENT (32768 * 8)
>
>   /* Align output to a power of two.  */
> ! #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
> !   do \
> !     { \
> !       if ((POWER) > 0) \
> ! fprintf (STREAM, "\t.align\t%d\n", POWER); \
> !     } \
> !   while (0)
>
>   #include "arm/aout.h"
>
> Index: thumb.h
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gcc/config/arm/thumb.h,v
> retrieving revision 1.32
> diff -p -r1.32 thumb.h
> *** thumb.h 2000/02/11 14:57:01 1.32
> --- thumb.h 2000/02/17 01:53:06
> *************** extern int target_flags;
> *** 142,151 ****
>   /* This is how to output an assembler line
>      that says to advance the location counter
>      to a multiple of 2**LOG bytes.  */
> ! #define ASM_OUTPUT_ALIGN(STREAM,LOG) \
> ! { \
> !   fprintf (STREAM, "\t.align\t%d\n", (LOG)); \
> ! }
>
>   /* Output a common block */
>   #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)  \
> --- 142,154 ----
>   /* This is how to output an assembler line
>      that says to advance the location counter
>      to a multiple of 2**LOG bytes.  */
> ! #define ASM_OUTPUT_ALIGN(STREAM,LOG) \
> !   do \
> !     { \
> !       if ((LOG) > 0) \
> ! fprintf (STREAM, "\t.align\t%d\n", LOG); \
> !     } \
> !   while (0)
>
>   /* Output a common block */
>   #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)  \
>


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