mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
PR24851, gas/testsuite/gas/epiphany/badrelax.s failure with MALLOC_PERTURB_=1
PR 24851 * config/tc-epiphany.c (md_estimate_size_before_relax): Clear extra opcode bytes when changing from a 2-byte to a 4-byte insn.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2019-08-12 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 24851
|
||||||
|
* config/tc-epiphany.c (md_estimate_size_before_relax): Clear
|
||||||
|
extra opcode bytes when changing from a 2-byte to a 4-byte insn.
|
||||||
|
|
||||||
2019-08-09 Jan Beulich <jbeulich@suse.com>
|
2019-08-09 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
* testsuite/gas/i386/ilp32/x86-64-simd-intel.d,
|
* testsuite/gas/i386/ilp32/x86-64-simd-intel.d,
|
||||||
|
@ -727,6 +727,8 @@ md_estimate_size_before_relax (fragS *fragP, segT segment)
|
|||||||
handling to md_convert_frag. */
|
handling to md_convert_frag. */
|
||||||
|
|
||||||
EPIPHANY_RELAX_TYPES subtype;
|
EPIPHANY_RELAX_TYPES subtype;
|
||||||
|
const CGEN_INSN *insn;
|
||||||
|
int i;
|
||||||
/* We haven't relaxed this at all, so the relaxation type may be
|
/* We haven't relaxed this at all, so the relaxation type may be
|
||||||
completely wrong. Set the subtype correctly. */
|
completely wrong. Set the subtype correctly. */
|
||||||
epiphany_relax_frag (segment, fragP, 0);
|
epiphany_relax_frag (segment, fragP, 0);
|
||||||
@ -753,26 +755,29 @@ md_estimate_size_before_relax (fragS *fragP, segT segment)
|
|||||||
|
|
||||||
fragP->fr_subtype = subtype;
|
fragP->fr_subtype = subtype;
|
||||||
|
|
||||||
{
|
/* Update the recorded insn. */
|
||||||
const CGEN_INSN *insn;
|
for (i = 0, insn = fragP->fr_cgen.insn; i < 4; i++, insn++)
|
||||||
int i;
|
{
|
||||||
|
if (strcmp (CGEN_INSN_MNEMONIC (insn),
|
||||||
|
CGEN_INSN_MNEMONIC (fragP->fr_cgen.insn)) == 0
|
||||||
|
&& CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Update the recorded insn. */
|
if (i == 4)
|
||||||
|
abort ();
|
||||||
|
|
||||||
for (i = 0, insn = fragP->fr_cgen.insn; i < 4; i++, insn++)
|
/* When changing from a 2-byte to 4-byte insn, don't leave
|
||||||
{
|
opcode bytes uninitialised. */
|
||||||
if ((strcmp (CGEN_INSN_MNEMONIC (insn),
|
if (CGEN_INSN_BITSIZE (fragP->fr_cgen.insn) < CGEN_INSN_BITSIZE (insn))
|
||||||
CGEN_INSN_MNEMONIC (fragP->fr_cgen.insn))
|
{
|
||||||
== 0)
|
gas_assert (CGEN_INSN_BITSIZE (fragP->fr_cgen.insn) == 16);
|
||||||
&& CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED))
|
gas_assert (CGEN_INSN_BITSIZE (insn) == 32);
|
||||||
break;
|
fragP->fr_opcode[2] = 0;
|
||||||
}
|
fragP->fr_opcode[3] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (i == 4)
|
fragP->fr_cgen.insn = insn;
|
||||||
abort ();
|
|
||||||
|
|
||||||
fragP->fr_cgen.insn = insn;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return md_relax_table[fragP->fr_subtype].rlx_length;
|
return md_relax_table[fragP->fr_subtype].rlx_length;
|
||||||
|
Reference in New Issue
Block a user