MFC r269393, r269394, r269395:

Fix parsing of arch extensions in binutils/gas.
  Use ".arch_extension sec" when compiling ARM TI code that uses the
  security extensions.
This commit is contained in:
ian 2014-08-11 01:48:00 +00:00
parent 059e60aeba
commit 8067096dad
2 changed files with 34 additions and 2 deletions

View File

@ -3837,6 +3837,7 @@ s_arm_eabi_attribute (int ignored ATTRIBUTE_UNUSED)
#endif /* OBJ_ELF */
static void s_arm_arch (int);
static void s_arm_arch_extension (int);
static void s_arm_object_arch (int);
static void s_arm_cpu (int);
static void s_arm_fpu (int);
@ -3891,6 +3892,7 @@ const pseudo_typeS md_pseudo_table[] =
{ "syntax", s_syntax, 0 },
{ "cpu", s_arm_cpu, 0 },
{ "arch", s_arm_arch, 0 },
{ "arch_extension", s_arm_arch_extension, 0 },
{ "object_arch", s_arm_object_arch, 0 },
{ "fpu", s_arm_fpu, 0 },
#ifdef OBJ_ELF
@ -20154,6 +20156,7 @@ static const struct arm_option_cpu_value_table arm_extensions[] =
{"xscale", ARM_FEATURE (0, ARM_CEXT_XSCALE)},
{"iwmmxt", ARM_FEATURE (0, ARM_CEXT_IWMMXT)},
{"iwmmxt2", ARM_FEATURE (0, ARM_CEXT_IWMMXT2)},
{"sec", ARM_FEATURE (ARM_EXT_V6Z, 0)},
{NULL, ARM_ARCH_NONE}
};
@ -20337,7 +20340,7 @@ arm_parse_arch (char * str)
}
for (opt = arm_archs; opt->name != NULL; opt++)
if (streq (opt->name, str))
if (strncmp (opt->name, str, optlen) == 0)
{
march_cpu_opt = &opt->value;
march_fpu_opt = &opt->default_fpu;
@ -20738,6 +20741,34 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED)
ignore_rest_of_line ();
}
/* Parse a .arch_extension directive. */
static void
s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED)
{
const struct arm_option_cpu_value_table *opt;
char saved_char;
char *name;
name = input_line_pointer;
while (*input_line_pointer && !ISSPACE(*input_line_pointer))
input_line_pointer++;
saved_char = *input_line_pointer;
*input_line_pointer = 0;
for (opt = arm_extensions; opt->name != NULL; opt++)
if (streq (opt->name, name))
{
ARM_MERGE_FEATURE_SETS (cpu_variant, cpu_variant, opt->value);
*input_line_pointer = saved_char;
demand_empty_rest_of_line ();
return;
}
as_bad (_("unknown architecture `%s'\n"), name);
*input_line_pointer = saved_char;
ignore_rest_of_line ();
}
/* Parse a .object_arch directive. */

View File

@ -26,7 +26,8 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
.arch armv7a
.arch armv7a
.arch_extension sec
/* Issue a smc #0 call */
/* r0 and r1 contains the eventual arguments, r2 contains the function ID */