From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11566 invoked by alias); 27 Sep 2011 15:36:20 -0000 Received: (qmail 11448 invoked by uid 22791); 27 Sep 2011 15:36:18 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Sep 2011 15:36:01 +0000 Received: by gyg8 with SMTP id 8so5968326gyg.20 for ; Tue, 27 Sep 2011 08:36:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.22.105 with SMTP id c9mr37309017pbf.88.1317137760616; Tue, 27 Sep 2011 08:36:00 -0700 (PDT) Received: by 10.68.55.101 with HTTP; Tue, 27 Sep 2011 08:36:00 -0700 (PDT) In-Reply-To: References: Date: Tue, 27 Sep 2011 16:47:00 -0000 Message-ID: Subject: Re: RFC: ARM: Add comment enumerating emitted .eabi_attribute tags From: Ramana Radhakrishnan To: Nick Clifton Cc: richard.earnshaw@arm.com, paul@codesourcery.com, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg01738.txt.bz2 Hi Nick, On 27 September 2011 15:38, Nick Clifton wrote: > =A0Any comments or objections to this patch ? =A0If not, I will apply it > =A0next week. I've got a few objections to this patch as it stands today while I don't object to the motivation for it. > +/* Get the definitions of the ARM EABI Attribute tag values. */ > +#define BFD_ARCH_SIZE > +#include "elf/arm.h" Defining BFD_ARCH_SIZE appears to be a bit of a hack. I would also ifdef this inclusion on TARGET_AAPCS since we shouldn't really be caring about object attributes for non AAPCS configurations. Does elf/arm.h get installed by bfd / binutils in some form as a part of it's build process ? Can the compiler find elf/arm.h by default for a non-combined-tree arm-linux-gnueabi / arm-eabi cross-build or a native boostrap ? (I suspect it might just about manage in a combined build in some form) . Expecting to add an additional include path for a normal build would leave a few people grumpy. Instead may I suggest rejigging this in a form so that we share this header file between gcc and binutils and make sure that this is sufficiently documented that one master copy lives in one repository while the other is a copy of this is in the other repository ? It has the same problems that we have with sharing other files between these 2 repositories but causing pain to every single script out there to add an include path to a default build sounds wrong to me. > > gcc/ChangeLog > 2011-09-27 =A0Nick Clifton =A0 > > =A0 =A0 =A0 =A0* config/arm/arm.c (EMIT_EABI_ATTRIBUTE): New macro. > =A0 =A0 =A0 =A0(arm_file_start): Use it to generate .eabi_attribute assem= bler > =A0 =A0 =A0 =A0pseudo-ops. The hunk for arm-c.c isn't documented in the Changelog. So, sorry I'm not happy as it stands today. cheers Ramana > > Index: gcc/config/arm/arm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/config/arm/arm.c =A0 =A0 =A0 =A0(revision 179269) > +++ gcc/config/arm/arm.c =A0 =A0 =A0 =A0(working copy) > @@ -22220,6 +22220,24 @@ > =A0 =A0 asm_fprintf (stream, "%U%s", name); > =A0} > > +/* Get the definitions of the ARM EABI Attribute tag values. =A0*/ > +#define BFD_ARCH_SIZE > +#include "elf/arm.h" > + > +/* This macro is used to emit an EABI tag and its associated value. > + =A0 We emit the numerical value of the tag in case the assembler does n= ot > + =A0 support textual tags. =A0(Eg gas prior to 2.20). =A0We include the = tag > + =A0 name in a comment so that anyone reading the assembler output will > + =A0 know which tag is being set. =A0*/ > +#define EMIT_EABI_ATTRIBUTE(name,val) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ > + =A0do =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ > + =A0 =A0{ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ > + =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute %d, %d\t%s " #= name "\n", \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0name, val, ASM_COMMENT_START); =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ > + =A0 =A0} =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ > + =A0while (0) > + > + > =A0static void > =A0arm_file_start (void) > =A0{ > @@ -22248,12 +22266,13 @@ > =A0 =A0 =A0 else > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0fpu_name =3D arm_fpu_desc->name; > + > =A0 =A0 =A0 =A0 =A0if (arm_fpu_desc->model =3D=3D ARM_FP_MODEL_VFP) > =A0 =A0 =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (TARGET_HARD_FLOAT) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribu= te 27, 3\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_HardFP_use, 3); > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (TARGET_HARD_FLOAT_ABI) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribu= te 28, 1\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_VFP_args, 1); > =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.fpu %s\n", fpu_name); > @@ -22262,31 +22281,25 @@ > =A0 =A0 =A0 =A0 =A0are used. =A0However we don't have any easy way of fig= uring this out. > =A0 =A0 =A0 =A0 Conservatively record the setting that would have been us= ed. =A0*/ > > - =A0 =A0 =A0/* Tag_ABI_FP_rounding. =A0*/ > =A0 =A0 =A0 if (flag_rounding_math) > - =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribute 19, 1\n"); > + =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_FP_rounding, 1); > + > =A0 =A0 =A0 if (!flag_unsafe_math_optimizations) > =A0 =A0 =A0 =A0{ > - =A0 =A0 =A0 =A0 /* Tag_ABI_FP_denomal. =A0*/ > - =A0 =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribute 20, 1\n"); > - =A0 =A0 =A0 =A0 /* Tag_ABI_FP_exceptions. =A0*/ > - =A0 =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribute 21, 1\n"); > + =A0 =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_FP_denormal, 1); > + =A0 =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_FP_exceptions, 1); > =A0 =A0 =A0 =A0} > - =A0 =A0 =A0/* Tag_ABI_FP_user_exceptions. =A0*/ > + > =A0 =A0 =A0 if (flag_signaling_nans) > - =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribute 22, 1\n"); > - =A0 =A0 =A0/* Tag_ABI_FP_number_model. =A0*/ > - =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 23, %d\n", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flag_finite_math_only ? 1 : 3); > + =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_FP_user_exceptions, 1); > > - =A0 =A0 =A0/* Tag_ABI_align8_needed. =A0*/ > - =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 24, 1\n"); > - =A0 =A0 =A0/* Tag_ABI_align8_preserved. =A0*/ > - =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 25, 1\n"); > - =A0 =A0 =A0/* Tag_ABI_enum_size. =A0*/ > - =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 26, %d\n", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flag_short_enums ? 1 : 2); > + =A0 =A0 =A0EMIT_EABI_ATTRIBUTE (Tag_ABI_FP_number_model, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flag_finite_math_onl= y ? 1 : 3); > > + =A0 =A0 =A0EMIT_EABI_ATTRIBUTE (Tag_ABI_align8_needed, 1); > + =A0 =A0 =A0EMIT_EABI_ATTRIBUTE (Tag_ABI_align8_preserved, 1); > + =A0 =A0 =A0EMIT_EABI_ATTRIBUTE (Tag_ABI_enum_size, flag_short_enums ? 1= : 2); > + > =A0 =A0 =A0 /* Tag_ABI_optimization_goals. =A0*/ > =A0 =A0 =A0 if (optimize_size) > =A0 =A0 =A0 =A0val =3D 4; > @@ -22296,21 +22309,18 @@ > =A0 =A0 =A0 =A0val =3D 1; > =A0 =A0 =A0 else > =A0 =A0 =A0 =A0val =3D 6; > - =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 30, %d\n", val= ); > + =A0 =A0 =A0EMIT_EABI_ATTRIBUTE (Tag_ABI_optimization_goals, val); > > - =A0 =A0 =A0/* Tag_CPU_unaligned_access. =A0*/ > - =A0 =A0 =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 34, %d\n", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unaligned_access); > + =A0 =A0 =A0EMIT_EABI_ATTRIBUTE (Tag_CPU_unaligned_access, unaligned_acc= ess); > > - =A0 =A0 =A0/* Tag_ABI_FP_16bit_format. =A0*/ > =A0 =A0 =A0 if (arm_fp16_format) > - =A0 =A0 =A0 asm_fprintf (asm_out_file, "\t.eabi_attribute 38, %d\n", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(int)arm_fp16_format); > + =A0 =A0 =A0 EMIT_EABI_ATTRIBUTE (Tag_ABI_FP_16bit_format, (int) arm_fp1= 6_format); > > =A0 =A0 =A0 if (arm_lang_output_object_attributes_hook) > =A0 =A0 =A0 =A0arm_lang_output_object_attributes_hook(); > =A0 =A0 } > - =A0default_file_start(); > + > + =A0default_file_start (); > =A0} > > =A0static void > Index: gcc/config/arm/arm-c.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/config/arm/arm-c.c =A0 =A0 =A0(revision 179247) > +++ gcc/config/arm/arm-c.c =A0 =A0 =A0(working copy) > @@ -32,8 +32,9 @@ > =A0static void arm_output_c_attributes(void) > =A0{ > =A0 /* Tag_ABI_PCS_wchar_t. =A0*/ > - =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 18, %d\n", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0(int)(TYPE_PRECISION (wchar_type_node) / BIT= S_PER_UNIT)); > + =A0asm_fprintf (asm_out_file, "\t.eabi_attribute 18, %d\t%s Tag_ABI_PCS= _wchar_t\n", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0(int)(TYPE_PRECISION (wchar_type_node) / BIT= S_PER_UNIT), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0ASM_COMMENT_START); > =A0} > > > >