GNU Binutils with patches for OS216
Revision | d92b1a8a2a1a736a4c5c125928dbab47a47551fc (tree) |
---|---|
Zeit | 2000-04-08 09:11:46 |
Autor | Nick Clifton <nickc@redh...> |
Commiter | Nick Clifton |
Add support for BFD_RELOC_{ARM|THUMB}_PCREL_BLX relocs.
@@ -1,3 +1,12 @@ | ||
1 | +2000-04-07 Nick Clifton <nickc@cygnus.com> | |
2 | + | |
3 | + * config/tc-arm.c (md_apply_fix3): Treat BFD_RELOC_ARM_PCREL_BLX | |
4 | + in the same way as BFD_RELOC_ARM_PCREL_BRANCH, and | |
5 | + BFD_RELOC_THUMB_PCREL_BLX lie BFD_RELOC_THUMB_PCREL_BRANCH. | |
6 | + (tc_gen_reloc): Accept BFD_RELOC_{ARM|THUMB}_PCREL_BLX. | |
7 | + (arm_force_relocation): Force relocations for | |
8 | + BFD_RELOC_{ARM|THUMB}_PCREL_BLX as well. | |
9 | + | |
1 | 10 | Wed Apr 5 22:26:32 2000 J"orn Rennecke <amylaar@cygnus.co.uk> |
2 | 11 | |
3 | 12 | * config/tc-sh.c (get_operands): There's no third operand if the |
@@ -2661,8 +2661,8 @@ do_adr (str, flags) | ||
2661 | 2661 | inst.reloc.exp.X_add_number -= 8; /* PC relative adjust. */ |
2662 | 2662 | inst.reloc.pc_rel = 1; |
2663 | 2663 | inst.instruction |= flags; |
2664 | + | |
2664 | 2665 | end_of_line (str); |
2665 | - return; | |
2666 | 2666 | } |
2667 | 2667 | |
2668 | 2668 | static void |
@@ -5370,6 +5370,7 @@ md_apply_fix3 (fixP, val, seg) | ||
5370 | 5370 | { |
5371 | 5371 | if (target_oabi |
5372 | 5372 | && (fixP->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH |
5373 | + || fixP->fx_r_type == BFD_RELOC_ARM_PCREL_BLX | |
5373 | 5374 | )) |
5374 | 5375 | value = 0; |
5375 | 5376 | else |
@@ -5617,6 +5618,22 @@ md_apply_fix3 (fixP, val, seg) | ||
5617 | 5618 | md_number_to_chars (buf, newval, INSN_SIZE); |
5618 | 5619 | break; |
5619 | 5620 | |
5621 | + case BFD_RELOC_ARM_PCREL_BLX: | |
5622 | + { | |
5623 | + offsetT hbit; | |
5624 | + newval = md_chars_to_number (buf, INSN_SIZE); | |
5625 | + | |
5626 | +#ifdef OBJ_ELF | |
5627 | + if (! target_oabi) | |
5628 | + value = fixP->fx_offset; | |
5629 | +#endif | |
5630 | + hbit = (value >> 1) & 1; | |
5631 | + value = (value >> 2) & 0x00ffffff; | |
5632 | + value = (value + (newval & 0x00ffffff)) & 0x00ffffff; | |
5633 | + newval = value | (newval & 0xfe000000) | (hbit << 24); | |
5634 | + md_number_to_chars (buf, newval, INSN_SIZE); | |
5635 | + } | |
5636 | + break; | |
5620 | 5637 | |
5621 | 5638 | case BFD_RELOC_THUMB_PCREL_BRANCH9: /* conditional branch */ |
5622 | 5639 | newval = md_chars_to_number (buf, THUMB_SIZE); |
@@ -5650,6 +5667,7 @@ md_apply_fix3 (fixP, val, seg) | ||
5650 | 5667 | md_number_to_chars (buf, newval, THUMB_SIZE); |
5651 | 5668 | break; |
5652 | 5669 | |
5670 | + case BFD_RELOC_THUMB_PCREL_BLX: | |
5653 | 5671 | case BFD_RELOC_THUMB_PCREL_BRANCH23: |
5654 | 5672 | { |
5655 | 5673 | offsetT newval2; |
@@ -5956,10 +5974,12 @@ tc_gen_reloc (section, fixp) | ||
5956 | 5974 | } |
5957 | 5975 | |
5958 | 5976 | case BFD_RELOC_ARM_PCREL_BRANCH: |
5977 | + case BFD_RELOC_ARM_PCREL_BLX: | |
5959 | 5978 | case BFD_RELOC_RVA: |
5960 | 5979 | case BFD_RELOC_THUMB_PCREL_BRANCH9: |
5961 | 5980 | case BFD_RELOC_THUMB_PCREL_BRANCH12: |
5962 | 5981 | case BFD_RELOC_THUMB_PCREL_BRANCH23: |
5982 | + case BFD_RELOC_THUMB_PCREL_BLX: | |
5963 | 5983 | case BFD_RELOC_VTABLE_ENTRY: |
5964 | 5984 | case BFD_RELOC_VTABLE_INHERIT: |
5965 | 5985 | code = fixp->fx_r_type; |
@@ -6172,10 +6192,12 @@ md_assemble (str) | ||
6172 | 6192 | keep trying with progressively smaller basic instructions until one |
6173 | 6193 | matches, or we run out of opcode. */ |
6174 | 6194 | q = (p - str > LONGEST_INST) ? str + LONGEST_INST : p; |
6195 | + | |
6175 | 6196 | for (; q != str; q--) |
6176 | 6197 | { |
6177 | 6198 | c = *q; |
6178 | 6199 | *q = '\0'; |
6200 | + | |
6179 | 6201 | opcode = (CONST struct asm_opcode *) hash_find (arm_ops_hsh, str); |
6180 | 6202 | *q = c; |
6181 | 6203 |
@@ -7102,6 +7124,8 @@ arm_force_relocation (fixp) | ||
7102 | 7124 | if ( fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT |
7103 | 7125 | || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY |
7104 | 7126 | || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH |
7127 | + || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX | |
7128 | + || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX | |
7105 | 7129 | || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23) |
7106 | 7130 | return 1; |
7107 | 7131 |