FreeBSD/contrib/binutils/gas/config/tc-arm.c
/* Set the public EABI object attributes.  */
Set the public EABI object attributes.
Set the public EABI object attributes .
static void
aeabi_set_public_attributes (void)
{
  int arch;
  arm_feature_set flags;
  arm_feature_set tmp;
  const cpu_arch_ver_table *p;
  ARM_MERGE_FEATURE_SETS (flags, arm_arch_used, thumb_arch_used);
  ARM_MERGE_FEATURE_SETS (flags, flags, *mfpu_opt);
  ARM_MERGE_FEATURE_SETS (flags, flags, selected_cpu);
  if (object_arch)
    {
      ARM_CLEAR_FEATURE (flags, flags, arm_arch_any);
      ARM_MERGE_FEATURE_SETS (flags, flags, *object_arch);
    }
  tmp = flags;
  arch = 0;
  for (p = cpu_arch_ver; p->val; p++)
    {
      if (ARM_CPU_HAS_FEATURE (tmp, p->flags))
	{
	  arch = p->val;
	  ARM_CLEAR_FEATURE (tmp, tmp, p->flags);
	}
    }
  if (selected_cpu_name[0])
    {
      char *p;
      p = selected_cpu_name;
      if (strncmp(p, "armv", 4) == 0)
	{
	  int i;
	  p += 4;
	  for (i = 0; p[i]; i++)
	    p[i] = TOUPPER (p[i]);
	}
      bfd_elf_add_proc_attr_string (stdoutput, 5, p);
    }
  bfd_elf_add_proc_attr_int (stdoutput, 6, arch);
  if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a))
    bfd_elf_add_proc_attr_int (stdoutput, 7, 'A');
  else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7r))
    bfd_elf_add_proc_attr_int (stdoutput, 7, 'R');
  else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7m))
    bfd_elf_add_proc_attr_int (stdoutput, 7, 'M');
  if (ARM_CPU_HAS_FEATURE (arm_arch_used, arm_arch_full))
    bfd_elf_add_proc_attr_int (stdoutput, 8, 1);
  if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_full))
    bfd_elf_add_proc_attr_int (stdoutput, 9,
	ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_t2) ? 2 : 1);
  if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v3)
      || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v3))
    bfd_elf_add_proc_attr_int (stdoutput, 10, 3);
  else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v2)
           || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v2))
    bfd_elf_add_proc_attr_int (stdoutput, 10, 2);
  else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1)
           || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1)
           || ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1xd)
           || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1xd))
    bfd_elf_add_proc_attr_int (stdoutput, 10, 1);
  if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_cext_iwmmxt)
      || ARM_CPU_HAS_FEATURE (arm_arch_used, arm_cext_iwmmxt))
    bfd_elf_add_proc_attr_int (stdoutput, 11, 1);
  if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_neon_ext_v1)
      || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_neon_ext_v1))
    bfd_elf_add_proc_attr_int (stdoutput, 12, 1);
}
static void aeabi_set_public_attributes ( void ) { int arch ; arm_feature_set flags ; arm_feature_set tmp ; const cpu_arch_ver_table * p ; ARM_MERGE_FEATURE_SETS ( flags , arm_arch_used , thumb_arch_used ) ; ARM_MERGE_FEATURE_SETS ( flags , flags , * mfpu_opt ) ; ARM_MERGE_FEATURE_SETS ( flags , flags , selected_cpu ) ; if ( object_arch ) { ARM_CLEAR_FEATURE ( flags , flags , arm_arch_any ) ; ARM_MERGE_FEATURE_SETS ( flags , flags , * object_arch ) ; } tmp = flags ; arch = 0 ; for ( p = cpu_arch_ver ; p -> val ; p ++ ) { if ( ARM_CPU_HAS_FEATURE ( tmp , p -> flags ) ) { arch = p -> val ; ARM_CLEAR_FEATURE ( tmp , tmp , p -> flags ) ; } } if ( selected_cpu_name [ 0 ] ) { char * p ; p = selected_cpu_name ; if ( strncmp ( p , " " , 4 ) == 0 ) { int i ; p += 4 ; for ( i = 0 ; p [ i ] ; i ++ ) p [ i ] = TOUPPER ( p [ i ] ) ; } bfd_elf_add_proc_attr_string ( stdoutput , 5 , p ) ; } bfd_elf_add_proc_attr_int ( stdoutput , 6 , arch ) ; if ( ARM_CPU_HAS_FEATURE ( flags , arm_ext_v7a ) ) bfd_elf_add_proc_attr_int ( stdoutput , 7 , ' ' ) ; else if ( ARM_CPU_HAS_FEATURE ( flags , arm_ext_v7r ) ) bfd_elf_add_proc_attr_int ( stdoutput , 7 , ' ' ) ; else if ( ARM_CPU_HAS_FEATURE ( flags , arm_ext_v7m ) ) bfd_elf_add_proc_attr_int ( stdoutput , 7 , ' ' ) ; if ( ARM_CPU_HAS_FEATURE ( arm_arch_used , arm_arch_full ) ) bfd_elf_add_proc_attr_int ( stdoutput , 8 , 1 ) ; if ( ARM_CPU_HAS_FEATURE ( thumb_arch_used , arm_arch_full ) ) bfd_elf_add_proc_attr_int ( stdoutput , 9 , ARM_CPU_HAS_FEATURE ( thumb_arch_used , arm_arch_t2 ) ? 2 : 1 ) ; if ( ARM_CPU_HAS_FEATURE ( thumb_arch_used , fpu_vfp_ext_v3 ) || ARM_CPU_HAS_FEATURE ( arm_arch_used , fpu_vfp_ext_v3 ) ) bfd_elf_add_proc_attr_int ( stdoutput , 10 , 3 ) ; else if ( ARM_CPU_HAS_FEATURE ( thumb_arch_used , fpu_vfp_ext_v2 ) || ARM_CPU_HAS_FEATURE ( arm_arch_used , fpu_vfp_ext_v2 ) ) bfd_elf_add_proc_attr_int ( stdoutput , 10 , 2 ) ; else if ( ARM_CPU_HAS_FEATURE ( thumb_arch_used , fpu_vfp_ext_v1 ) || ARM_CPU_HAS_FEATURE ( arm_arch_used , fpu_vfp_ext_v1 ) || ARM_CPU_HAS_FEATURE ( thumb_arch_used , fpu_vfp_ext_v1xd ) || ARM_CPU_HAS_FEATURE ( arm_arch_used , fpu_vfp_ext_v1xd ) ) bfd_elf_add_proc_attr_int ( stdoutput , 10 , 1 ) ; if ( ARM_CPU_HAS_FEATURE ( thumb_arch_used , arm_cext_iwmmxt ) || ARM_CPU_HAS_FEATURE ( arm_arch_used , arm_cext_iwmmxt ) ) bfd_elf_add_proc_attr_int ( stdoutput , 11 , 1 ) ; if ( ARM_CPU_HAS_FEATURE ( thumb_arch_used , fpu_neon_ext_v1 ) || ARM_CPU_HAS_FEATURE ( arm_arch_used , fpu_neon_ext_v1 ) ) bfd_elf_add_proc_attr_int ( stdoutput , 12 , 1 ) ; }
Set the public EABI object attributes.
Set the public EABI object attributes .
/* Choose the architecture based on the capabilities of the requested cpu
     (if any) and/or the instructions actually used.  */ /*Allow the user to override the reported architecture.  */ /* Tag_CPU_name.  */ /* Tag_CPU_arch.  */ /* Tag_CPU_arch_profile.  */ /* Tag_ARM_ISA_use.  */ /* Tag_THUMB_ISA_use.  */ /* Tag_VFP_arch.  */ /* Tag_WMMX_arch.  */ /* Tag_NEON_arch.  */