mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
* config/tc-mn10200.c (md_relax_table): Add entries to allow
jmp -> bra relaxing. (md_convert_frag): Handle jmp->bra relaxing. (md_assemble): Handle jmp->bra relaxing. (md_estimate_size_before_relax): Likewise.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
Fri Jan 31 15:21:02 1997 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
|
* config/tc-mn10200.c (md_relax_table): Add entries to allow
|
||||||
|
jmp -> bra relaxing.
|
||||||
|
(md_convert_frag): Handle jmp->bra relaxing.
|
||||||
|
(md_assemble): Handle jmp->bra relaxing.
|
||||||
|
(md_estimate_size_before_relax): Likewise.
|
||||||
|
|
||||||
Fri Jan 31 13:15:05 1997 Alan Modra <alan@spri.levels.unisa.edu.au>
|
Fri Jan 31 13:15:05 1997 Alan Modra <alan@spri.levels.unisa.edu.au>
|
||||||
|
|
||||||
* config/tc-i386.c (i386_align_code): Add comments explaining the
|
* config/tc-i386.c (i386_align_code): Add comments explaining the
|
||||||
|
@ -62,9 +62,13 @@ const relax_typeS md_relax_table[] = {
|
|||||||
{0x7f, -0x80, 3, 4},
|
{0x7f, -0x80, 3, 4},
|
||||||
{0x7fff, -0x8000, 6, 5},
|
{0x7fff, -0x8000, 6, 5},
|
||||||
{0x7fffff, -0x8000000, 8, 0},
|
{0x7fffff, -0x8000000, 8, 0},
|
||||||
/* jmp/jsr relaxing, could have a bra variant too! */
|
/* jsr relaxing */
|
||||||
{0x7fff, -0x8000, 3, 7},
|
{0x7fff, -0x8000, 3, 7},
|
||||||
{0x7fffff, -0x8000000, 5, 0},
|
{0x7fffff, -0x8000000, 5, 0},
|
||||||
|
/* jmp relaxing */
|
||||||
|
{0x7f, -0x80, 2, 9},
|
||||||
|
{0x7fff, -0x8000, 3, 10},
|
||||||
|
{0x7fffff, -0x8000000, 5, 0},
|
||||||
|
|
||||||
};
|
};
|
||||||
/* local functions */
|
/* local functions */
|
||||||
@ -667,20 +671,37 @@ md_convert_frag (abfd, sec, fragP)
|
|||||||
else if (fragP->fr_subtype == 7)
|
else if (fragP->fr_subtype == 7)
|
||||||
{
|
{
|
||||||
int offset = fragP->fr_fix;
|
int offset = fragP->fr_fix;
|
||||||
int opcode = fragP->fr_literal[offset] & 0xff;
|
|
||||||
|
|
||||||
if (opcode == 0xfc)
|
|
||||||
{
|
|
||||||
fragP->fr_literal[offset] = 0xf4;
|
|
||||||
fragP->fr_literal[offset + 1] = 0xe0;
|
|
||||||
}
|
|
||||||
else if (opcode == 0xfd)
|
|
||||||
{
|
|
||||||
fragP->fr_literal[offset] = 0xf4;
|
fragP->fr_literal[offset] = 0xf4;
|
||||||
fragP->fr_literal[offset + 1] = 0xe1;
|
fragP->fr_literal[offset + 1] = 0xe1;
|
||||||
|
|
||||||
|
fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
|
||||||
|
fragP->fr_offset + 2, 1, BFD_RELOC_24_PCREL);
|
||||||
|
fragP->fr_var = 0;
|
||||||
|
fragP->fr_fix += 5;
|
||||||
}
|
}
|
||||||
else
|
else if (fragP->fr_subtype == 8)
|
||||||
abort ();
|
{
|
||||||
|
fragP->fr_literal[fragP->fr_fix] = 0xea;
|
||||||
|
fix_new (fragP, fragP->fr_fix + 1, 1, fragP->fr_symbol,
|
||||||
|
fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
|
||||||
|
fragP->fr_var = 0;
|
||||||
|
fragP->fr_fix += 2;
|
||||||
|
}
|
||||||
|
else if (fragP->fr_subtype == 9)
|
||||||
|
{
|
||||||
|
int offset = fragP->fr_fix;
|
||||||
|
fragP->fr_literal[offset] = 0xfc;
|
||||||
|
|
||||||
|
fix_new (fragP, fragP->fr_fix + 1, 4, fragP->fr_symbol,
|
||||||
|
fragP->fr_offset + 1, 1, BFD_RELOC_16_PCREL);
|
||||||
|
fragP->fr_var = 0;
|
||||||
|
fragP->fr_fix += 3;
|
||||||
|
}
|
||||||
|
else if (fragP->fr_subtype == 10)
|
||||||
|
{
|
||||||
|
int offset = fragP->fr_fix;
|
||||||
|
fragP->fr_literal[offset] = 0xf4;
|
||||||
|
fragP->fr_literal[offset + 1] = 0xe0;
|
||||||
|
|
||||||
fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
|
fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
|
||||||
fragP->fr_offset + 2, 1, BFD_RELOC_24_PCREL);
|
fragP->fr_offset + 2, 1, BFD_RELOC_24_PCREL);
|
||||||
@ -1019,13 +1040,19 @@ keep_going:
|
|||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
if (size == 2)
|
/* bCC */
|
||||||
|
if (size == 2 && opcode->opcode != 0xfc0000)
|
||||||
type = 0;
|
type = 0;
|
||||||
else if (size == 3
|
/* jsr */
|
||||||
&& opcode->opcode != 0xfd0000 && opcode->opcode != 0xfc0000)
|
else if (size == 3 && opcode->opcode == 0xfd0000)
|
||||||
type = 3;
|
|
||||||
else
|
|
||||||
type = 6;
|
type = 6;
|
||||||
|
/* jmp */
|
||||||
|
else if (size == 3 && opcode->opcode == 0xfc0000)
|
||||||
|
type = 8;
|
||||||
|
/* bCCx */
|
||||||
|
else
|
||||||
|
type = 3;
|
||||||
|
|
||||||
f = frag_var (rs_machine_dependent, 8, 8 - size, type,
|
f = frag_var (rs_machine_dependent, 8, 8 - size, type,
|
||||||
fixups[0].exp.X_add_symbol,
|
fixups[0].exp.X_add_symbol,
|
||||||
fixups[0].exp.X_add_number,
|
fixups[0].exp.X_add_number,
|
||||||
@ -1208,9 +1235,18 @@ md_estimate_size_before_relax (fragp, seg)
|
|||||||
fragp->fr_subtype = 7;
|
fragp->fr_subtype = 7;
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
if (fragp->fr_subtype == 8)
|
||||||
|
{
|
||||||
|
if (!S_IS_DEFINED (fragp->fr_symbol))
|
||||||
|
{
|
||||||
|
fragp->fr_subtype = 10;
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
long
|
long
|
||||||
md_pcrel_from (fixp)
|
md_pcrel_from (fixp)
|
||||||
|
Reference in New Issue
Block a user