cast the arg to md_assemble () to char *

For these targets its not clear how md_assemble can usefully be split up so
that part can take const char *.  There is also a fair number of targets that
need md_assemble () to take a char *, so we can't easily make the argument
const.  So since there isn't many callers it seems easiest to just add a couple
of casts.

gas/ChangeLog:

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

	* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
	char *.
	(m32c_indirect_operand): Likewise.
	* config/tc-nds32.c (do_pseudo_b): Likewise.
	(do_pseudo_bal): Likewise.
	(do_pseudo_ls_bhw): Likewise.
This commit is contained in:
Trevor Saunders 2016-03-20 01:13:05 -04:00
parent 97830986a1
commit f854977c23
3 changed files with 18 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
char *.
(m32c_indirect_operand): Likewise.
* config/tc-nds32.c (do_pseudo_b): Likewise.
(do_pseudo_bal): Likewise.
(do_pseudo_ls_bhw): Likewise.
2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* as.c (parse_args): Cast literal to char * when assigning to optarg.

View File

@ -200,7 +200,7 @@ m32c_md_end (void)
/* Pad with nops for objdump. */
n_nops = (32 - ((insn_size) % 32)) / 8;
for (i = 1; i <= n_nops; i++)
md_assemble ("nop");
md_assemble ((char *) "nop");
}
}
@ -317,11 +317,11 @@ m32c_indirect_operand (char *str)
}
if (indirection[1] != none && indirection[2] != none)
md_assemble ("src-dest-indirect");
md_assemble ((char *) "src-dest-indirect");
else if (indirection[1] != none)
md_assemble ("src-indirect");
md_assemble ((char *) "src-indirect");
else if (indirection[2] != none)
md_assemble ("dest-indirect");
md_assemble ((char *) "dest-indirect");
md_assemble (new_str);
free (new_str);

View File

@ -2202,8 +2202,8 @@ do_pseudo_b (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED)
{
md_assemblef ("sethi $ta,hi20(%s)", arg_label);
md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label);
md_assemble ("add $ta,$ta,$gp");
md_assemble ("jr $ta");
md_assemble ((char *) "add $ta,$ta,$gp");
md_assemble ((char *) "jr $ta");
}
else
{
@ -2223,8 +2223,8 @@ do_pseudo_bal (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED)
{
md_assemblef ("sethi $ta,hi20(%s)", arg_label);
md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label);
md_assemble ("add $ta,$ta,$gp");
md_assemble ("jral $ta");
md_assemble ((char *) "add $ta,$ta,$gp");
md_assemble ((char *) "jral $ta");
}
else
{
@ -2483,7 +2483,7 @@ do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], int pv)
/* lw */
md_assemblef ("sethi $ta,hi20(%s)", argv[1]);
md_assemblef ("ori $ta,$ta,lo12(%s)", argv[1]);
md_assemble ("lw $ta,[$gp+$ta]"); /* Load address word. */
md_assemble ((char *) "lw $ta,[$gp+$ta]"); /* Load address word. */
if (addend < 0x10000 && addend >= -0x10000)
{
md_assemblef ("%c%c%si %s,[$ta+(%d)]", ls, size, sign, argv[0], addend);