nlen = strlen (newname);
#endif
- nbuf = alloca (nlen + 1);
+ nbuf = xmalloc (nlen + 1);
memcpy (nbuf, newname, nlen);
nbuf[nlen] = '\0';
the artificial FOO alias because it has already been created by the
first .req. */
if (insert_reg_alias (nbuf, old->number, old->type) == NULL)
- return TRUE;
+ {
+ free (nbuf);
+ return TRUE;
+ }
}
for (p = nbuf; *p; p++)
insert_reg_alias (nbuf, old->number, old->type);
}
+ free (nbuf);
return TRUE;
}
static void
output_info (const char *format, ...)
{
- char *file;
+ const char *file;
unsigned int line;
va_list args;
- as_where (&file, &line);
+ file = as_where (&line);
if (file)
{
if (line != 0)
struct aarch64_option_table
{
- char *option; /* Option name to match. */
- char *help; /* Help information. */
+ const char *option; /* Option name to match. */
+ const char *help; /* Help information. */
int *var; /* Variable to change. */
int value; /* What to change it to. */
char *deprecated; /* If non-null, print this message. */
struct aarch64_cpu_option_table
{
- char *name;
+ const char *name;
const aarch64_feature_set value;
/* The canonical name of the CPU, or NULL to use NAME converted to upper
case. */
struct aarch64_arch_option_table
{
- char *name;
+ const char *name;
const aarch64_feature_set value;
};
/* ISA extensions. */
struct aarch64_option_cpu_value_table
{
- char *name;
+ const char *name;
const aarch64_feature_set value;
};
struct aarch64_long_option_table
{
- char *option; /* Substring to match. */
- char *help; /* Help information. */
- int (*func) (char *subopt); /* Function to decode sub-option. */
+ const char *option; /* Substring to match. */
+ const char *help; /* Help information. */
+ int (*func) (const char *subopt); /* Function to decode sub-option. */
char *deprecated; /* If non-null, print this message. */
};
static int
-aarch64_parse_features (char *str, const aarch64_feature_set **opt_p,
+aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p,
bfd_boolean ext_only)
{
/* We insist on extensions being added before being removed. We achieve
while (str != NULL && *str != 0)
{
const struct aarch64_option_cpu_value_table *opt;
- char *ext = NULL;
+ const char *ext = NULL;
int optlen;
if (!ext_only)
}
static int
-aarch64_parse_cpu (char *str)
+aarch64_parse_cpu (const char *str)
{
const struct aarch64_cpu_option_table *opt;
- char *ext = strchr (str, '+');
+ const char *ext = strchr (str, '+');
size_t optlen;
if (ext != NULL)
}
static int
-aarch64_parse_arch (char *str)
+aarch64_parse_arch (const char *str)
{
const struct aarch64_arch_option_table *opt;
- char *ext = strchr (str, '+');
+ const char *ext = strchr (str, '+');
size_t optlen;
if (ext != NULL)
/* ABIs. */
struct aarch64_option_abi_value_table
{
- char *name;
+ const char *name;
enum aarch64_abi_type value;
};
};
static int
-aarch64_parse_abi (char *str)
+aarch64_parse_abi (const char *str)
{
const struct aarch64_option_abi_value_table *opt;
size_t optlen = strlen (str);
};
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
struct aarch64_option_table *opt;
struct aarch64_long_option_table *lopt;