add more const qualifiers

gas/ChangeLog:

2016-03-28  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/obj-elf.c (obj_elf_section_name): Return const char *.
	* config/obj-elf.h (obj_elf_section_name): Adjust.
	* config/tc-aarch64.c (aarch64_parse_features): Likewise.
	(aarch64_parse_cpu): Likewise.
	(aarch64_parse_arch): Likewise.
	* config/tc-arm.c (arm_parse_extension): Likewise.
	(arm_parse_cpu): Likewise.
	(arm_parse_arch): Likewise.
	* config/tc-nds32.c: Likewise.
	* config/xtensa-relax.c (parse_special_fn): Likewise.
	* stabs.c (generate_asm_file): Likewise.
This commit is contained in:
Trevor Saunders 2016-03-23 22:39:13 -04:00
parent 5fa9f97233
commit 82b8a7851f
8 changed files with 31 additions and 16 deletions

View file

@ -1,3 +1,17 @@
2016-03-28 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/obj-elf.c (obj_elf_section_name): Return const char *.
* config/obj-elf.h (obj_elf_section_name): Adjust.
* config/tc-aarch64.c (aarch64_parse_features): Likewise.
(aarch64_parse_cpu): Likewise.
(aarch64_parse_arch): Likewise.
* config/tc-arm.c (arm_parse_extension): Likewise.
(arm_parse_cpu): Likewise.
(arm_parse_arch): Likewise.
* config/tc-nds32.c: Likewise.
* config/xtensa-relax.c (parse_special_fn): Likewise.
* stabs.c (generate_asm_file): Likewise.
2016-03-25 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-cr16.c (cr16_assemble): New function.

View file

@ -918,7 +918,7 @@ obj_elf_section_word (char *str, size_t len, int *type)
}
/* Get name of section. */
char *
const char *
obj_elf_section_name (void)
{
char *name;
@ -984,7 +984,8 @@ obj_elf_section_name (void)
void
obj_elf_section (int push)
{
char *name, *group_name, *beg;
const char *name, *group_name;
char *beg;
int type, dummy;
bfd_vma attr;
int entsize;

View file

@ -155,7 +155,7 @@ extern void elf_file_symbol (const char *, int);
extern void obj_elf_section_change_hook (void);
extern void obj_elf_section (int);
extern char * obj_elf_section_name (void);
extern const char * obj_elf_section_name (void);
extern void obj_elf_previous (int);
extern void obj_elf_version (int);
extern void obj_elf_common (int);

View file

@ -7830,7 +7830,7 @@ struct aarch64_long_option_table
};
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
@ -7847,7 +7847,7 @@ aarch64_parse_features (char *str, const aarch64_feature_set **opt_p,
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)
@ -7920,7 +7920,7 @@ static int
aarch64_parse_cpu (char *str)
{
const struct aarch64_cpu_option_table *opt;
char *ext = strchr (str, '+');
const char *ext = strchr (str, '+');
size_t optlen;
if (ext != NULL)
@ -7952,7 +7952,7 @@ static int
aarch64_parse_arch (char *str)
{
const struct aarch64_arch_option_table *opt;
char *ext = strchr (str, '+');
const char *ext = strchr (str, '+');
size_t optlen;
if (ext != NULL)

View file

@ -25586,7 +25586,7 @@ struct arm_long_option_table
};
static bfd_boolean
arm_parse_extension (char *str, const arm_feature_set **opt_p)
arm_parse_extension (const char *str, const arm_feature_set **opt_p)
{
arm_feature_set *ext_set = (arm_feature_set *)
xmalloc (sizeof (arm_feature_set));
@ -25606,7 +25606,7 @@ arm_parse_extension (char *str, const arm_feature_set **opt_p)
while (str != NULL && *str != 0)
{
char *ext;
const char *ext;
size_t len;
if (*str != '+')
@ -25712,7 +25712,7 @@ static bfd_boolean
arm_parse_cpu (char *str)
{
const struct arm_cpu_option_table *opt;
char *ext = strchr (str, '+');
const char *ext = strchr (str, '+');
size_t len;
if (ext != NULL)
@ -25762,7 +25762,7 @@ static bfd_boolean
arm_parse_arch (char *str)
{
const struct arm_arch_option_table *opt;
char *ext = strchr (str, '+');
const char *ext = strchr (str, '+');
size_t len;
if (ext != NULL)

View file

@ -2986,7 +2986,7 @@ nds32_init_nds32_pseudo_opcodes (void)
}
static struct nds32_pseudo_opcode *
nds32_lookup_pseudo_opcode (char *str)
nds32_lookup_pseudo_opcode (const char *str)
{
int i = 0;
/* Assume pseudo-opcode are less than 16-char in length. */
@ -4138,7 +4138,7 @@ nds32_elf_save_pseudo_pattern (fixS* fixP, struct nds32_opcode *opcode,
/* Check X_md to transform relocation. */
static fixS*
nds32_elf_record_fixup_exp (fragS *fragP, char *str,
nds32_elf_record_fixup_exp (fragS *fragP, const char *str,
const struct nds32_field *fld,
expressionS *pexp, char* out,
struct nds32_asm_insn *insn)
@ -5102,7 +5102,7 @@ restore:
/* Check instruction if it can be used for the baseline. */
static bfd_boolean
nds32_check_insn_available (struct nds32_asm_insn insn, char *str)
nds32_check_insn_available (struct nds32_asm_insn insn, const char *str)
{
int attr = insn.attr & ATTR_ALL;
static int baseline_isa = 0;

View file

@ -1024,7 +1024,7 @@ parse_special_fn (const char *name,
const char **fn_name_p,
const char **arg_name_p)
{
char *p_start;
const char *p_start;
const char *p_end;
p_start = strchr (name, '(');

View file

@ -545,7 +545,7 @@ generate_asm_file (int type, const char *file)
while (tmp < file_endp)
{
char *bslash = strchr (tmp, '\\');
const char *bslash = strchr (tmp, '\\');
size_t len = (bslash) ? (size_t) (bslash - tmp + 1) : strlen (tmp);
/* Double all backslashes, since demand_copy_C_string (used by