mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
* config/tc-mn10300.c (md_assemble): Simplify offset adjustment of
pc-relative relocations not placed at the end of the instruction.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2001-04-14 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
|
* config/tc-mn10300.c (md_assemble): Simplify offset adjustment of
|
||||||
|
pc-relative relocations not placed at the end of the instruction.
|
||||||
|
|
||||||
2001-04-13 Jim Wilson <wilson@redhat.com>
|
2001-04-13 Jim Wilson <wilson@redhat.com>
|
||||||
|
|
||||||
* tc-ia64.c (is_conditional_branch): Return true for br, brl, and br.
|
* tc-ia64.c (is_conditional_branch): Return true for br, brl, and br.
|
||||||
|
@ -937,7 +937,7 @@ md_assemble (str)
|
|||||||
struct mn10300_opcode *next_opcode;
|
struct mn10300_opcode *next_opcode;
|
||||||
const unsigned char *opindex_ptr;
|
const unsigned char *opindex_ptr;
|
||||||
int next_opindex, relaxable;
|
int next_opindex, relaxable;
|
||||||
unsigned long insn, extension, size = 0, real_size;
|
unsigned long insn, extension, size = 0;
|
||||||
char *f;
|
char *f;
|
||||||
int i;
|
int i;
|
||||||
int match;
|
int match;
|
||||||
@ -1513,8 +1513,6 @@ keep_going:
|
|||||||
if (opcode->format == FMT_D4)
|
if (opcode->format == FMT_D4)
|
||||||
size = 6;
|
size = 6;
|
||||||
|
|
||||||
real_size = size;
|
|
||||||
|
|
||||||
if (relaxable && fc > 0)
|
if (relaxable && fc > 0)
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
@ -1729,25 +1727,14 @@ keep_going:
|
|||||||
/* Is the reloc pc-relative? */
|
/* Is the reloc pc-relative? */
|
||||||
pcrel = (operand->flags & MN10300_OPERAND_PCREL) != 0;
|
pcrel = (operand->flags & MN10300_OPERAND_PCREL) != 0;
|
||||||
|
|
||||||
/* Gross. This disgusting hack is to make sure we
|
|
||||||
get the right offset for the 16/32 bit reloc in
|
|
||||||
"call" instructions. Basically they're a pain
|
|
||||||
because the reloc isn't at the end of the instruction. */
|
|
||||||
if ((size == 5 || size == 7)
|
|
||||||
&& (((insn >> 24) & 0xff) == 0xcd
|
|
||||||
|| ((insn >> 24) & 0xff) == 0xdd))
|
|
||||||
size -= 2;
|
|
||||||
|
|
||||||
/* Similarly for certain bit instructions which don't
|
|
||||||
hav their 32bit reloc at the tail of the instruction. */
|
|
||||||
if (size == 7
|
|
||||||
&& (((insn >> 16) & 0xffff) == 0xfe00
|
|
||||||
|| ((insn >> 16) & 0xffff) == 0xfe01
|
|
||||||
|| ((insn >> 16) & 0xffff) == 0xfe02))
|
|
||||||
size -= 1;
|
|
||||||
|
|
||||||
offset = size - reloc_size / 8;
|
offset = size - reloc_size / 8;
|
||||||
|
|
||||||
|
/* If the pcrel relocation isn't at the end of the insn,
|
||||||
|
we have to adjust the offset for the relocation to be
|
||||||
|
correct. */
|
||||||
|
if (pcrel)
|
||||||
|
offset -= operand->shift / 8;
|
||||||
|
|
||||||
/* Choose a proper BFD relocation type. */
|
/* Choose a proper BFD relocation type. */
|
||||||
if (pcrel)
|
if (pcrel)
|
||||||
{
|
{
|
||||||
@ -1791,7 +1778,7 @@ keep_going:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dwarf2_emit_insn (real_size);
|
dwarf2_emit_insn (size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If while processing a fixup, a reloc really needs to be created
|
/* If while processing a fixup, a reloc really needs to be created
|
||||||
|
Reference in New Issue
Block a user