* config/tc-arm.c (do_t_ldmstm): Change BFD_RELOC_NONE to

BFD_RELOC_UNUSED.
	(do_t_push_pop): Likewise.
	(md_assemble): Likewise.
	(md_apply_fix3): Handle BFD_RELOC_NONE correctly, make BFD_RELOC_UNUSED
	same as previous meaning of BFD_RELOC_NONE.
	(create_unwind_entry): Output dependency on the required personality
	routines.
	testsuite/gas/arm/unwind.d: Alter expected output to include dependency
	on __aeabi_unwind_cpp_pr[01].
This commit is contained in:
Julian Brown 2005-02-10 12:39:17 +00:00
parent d457dcf698
commit 620b81c130
3 changed files with 51 additions and 10 deletions

View File

@ -1,3 +1,16 @@
2005-02-10 Julian Brown <julian@codesourcery.com>
* config/tc-arm.c (do_t_ldmstm): Change BFD_RELOC_NONE to
BFD_RELOC_UNUSED.
(do_t_push_pop): Likewise.
(md_assemble): Likewise.
(md_apply_fix3): Handle BFD_RELOC_NONE correctly, make
BFD_RELOC_UNUSED same as previous meaning of BFD_RELOC_NONE.
(create_unwind_entry): Output dependency on the required personality
routines.
testsuite/gas/arm/unwind.d: Alter expected output to include
dependency on __aeabi_unwind_cpp_pr[01].
2005-02-07 Nathan Sidwell <nathan@codesourcery.com> 2005-02-07 Nathan Sidwell <nathan@codesourcery.com>
* as.h (seg_not_empty_p): Return int, not bfd_boolean. * as.h (seg_not_empty_p): Return int, not bfd_boolean.

View File

@ -9369,10 +9369,10 @@ do_t_ldmstm (char * str)
return; return;
} }
if (inst.reloc.type != BFD_RELOC_NONE) if (inst.reloc.type != BFD_RELOC_UNUSED)
{ {
/* This really doesn't seem worth it. */ /* This really doesn't seem worth it. */
inst.reloc.type = BFD_RELOC_NONE; inst.reloc.type = BFD_RELOC_UNUSED;
inst.error = _("expression too complex"); inst.error = _("expression too complex");
return; return;
} }
@ -9461,10 +9461,10 @@ do_t_push_pop (char * str)
return; return;
} }
if (inst.reloc.type != BFD_RELOC_NONE) if (inst.reloc.type != BFD_RELOC_UNUSED)
{ {
/* This really doesn't seem worth it. */ /* This really doesn't seem worth it. */
inst.reloc.type = BFD_RELOC_NONE; inst.reloc.type = BFD_RELOC_UNUSED;
inst.error = _("expression too complex"); inst.error = _("expression too complex");
return; return;
} }
@ -11361,7 +11361,7 @@ md_apply_fix3 (fixS * fixP,
char * buf = fixP->fx_where + fixP->fx_frag->fr_literal; char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
arm_fix_data * arm_data = (arm_fix_data *) fixP->tc_fix_data; arm_fix_data * arm_data = (arm_fix_data *) fixP->tc_fix_data;
assert (fixP->fx_r_type < BFD_RELOC_UNUSED); assert (fixP->fx_r_type <= BFD_RELOC_UNUSED);
/* Note whether this will delete the relocation. */ /* Note whether this will delete the relocation. */
if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
@ -11383,6 +11383,11 @@ md_apply_fix3 (fixS * fixP,
switch (fixP->fx_r_type) switch (fixP->fx_r_type)
{ {
case BFD_RELOC_NONE:
/* This will need to go in the object file. */
fixP->fx_done = 0;
break;
case BFD_RELOC_ARM_IMMEDIATE: case BFD_RELOC_ARM_IMMEDIATE:
/* We claim that this fixup has been processed here, /* We claim that this fixup has been processed here,
even if in fact we generate an error because we do even if in fact we generate an error because we do
@ -12050,7 +12055,7 @@ md_apply_fix3 (fixS * fixP,
fixP->fx_done = 0; fixP->fx_done = 0;
return; return;
case BFD_RELOC_NONE: case BFD_RELOC_UNUSED:
default: default:
as_bad_where (fixP->fx_file, fixP->fx_line, as_bad_where (fixP->fx_file, fixP->fx_line,
_("bad relocation fixup type (%d)"), fixP->fx_r_type); _("bad relocation fixup type (%d)"), fixP->fx_r_type);
@ -12106,6 +12111,7 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED,
break; break;
} }
case BFD_RELOC_NONE:
case BFD_RELOC_ARM_PCREL_BRANCH: case BFD_RELOC_ARM_PCREL_BRANCH:
case BFD_RELOC_ARM_PCREL_BLX: case BFD_RELOC_ARM_PCREL_BLX:
case BFD_RELOC_RVA: case BFD_RELOC_RVA:
@ -12170,6 +12176,7 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED,
switch (fixp->fx_r_type) switch (fixp->fx_r_type)
{ {
case BFD_RELOC_NONE: type = "NONE"; break;
case BFD_RELOC_ARM_OFFSET_IMM8: type = "OFFSET_IMM8"; break; case BFD_RELOC_ARM_OFFSET_IMM8: type = "OFFSET_IMM8"; break;
case BFD_RELOC_ARM_SHIFT_IMM: type = "SHIFT_IMM"; break; case BFD_RELOC_ARM_SHIFT_IMM: type = "SHIFT_IMM"; break;
case BFD_RELOC_ARM_SMI: type = "SMI"; break; case BFD_RELOC_ARM_SMI: type = "SMI"; break;
@ -12293,7 +12300,7 @@ output_inst (const char * str)
else else
md_number_to_chars (to, inst.instruction, inst.size); md_number_to_chars (to, inst.instruction, inst.size);
if (inst.reloc.type != BFD_RELOC_NONE) if (inst.reloc.type != BFD_RELOC_UNUSED)
fix_new_arm (frag_now, to - frag_now->fr_literal, fix_new_arm (frag_now, to - frag_now->fr_literal,
inst.size, & inst.reloc.exp, inst.reloc.pc_rel, inst.size, & inst.reloc.exp, inst.reloc.pc_rel,
inst.reloc.type); inst.reloc.type);
@ -12319,7 +12326,7 @@ md_assemble (char * str)
} }
memset (&inst, '\0', sizeof (inst)); memset (&inst, '\0', sizeof (inst));
inst.reloc.type = BFD_RELOC_NONE; inst.reloc.type = BFD_RELOC_UNUSED;
skip_whitespace (str); skip_whitespace (str);
@ -13893,6 +13900,14 @@ create_unwind_entry (int have_data)
/* Custom personality routine. */ /* Custom personality routine. */
fix_new (frag_now, where, 4, unwind.personality_routine, 0, 1, fix_new (frag_now, where, 4, unwind.personality_routine, 0, 1,
BFD_RELOC_ARM_PREL31); BFD_RELOC_ARM_PREL31);
/* Indicate dependency to linker. */
{
char *name = "__aeabi_unwind_cpp_pr0";
symbolS *pr = symbol_find_or_make (name);
fix_new (frag_now, where, 4, pr, 0, 1, BFD_RELOC_NONE);
}
where += 4; where += 4;
ptr += 4; ptr += 4;
@ -13902,18 +13917,28 @@ create_unwind_entry (int have_data)
break; break;
/* ABI defined personality routines. */ /* ABI defined personality routines. */
/* TODO: Emit R_ARM_NONE to the personality routine. */
case 0: case 0:
/* Three opcodes bytes are packed into the first word. */ /* Three opcodes bytes are packed into the first word. */
data = 0x80; data = 0x80;
n = 3; n = 3;
break; goto emit_reloc;
case 1: case 1:
case 2: case 2:
/* The size and first two opcode bytes go in the first word. */ /* The size and first two opcode bytes go in the first word. */
data = ((0x80 + unwind.personality_index) << 8) | size; data = ((0x80 + unwind.personality_index) << 8) | size;
n = 2; n = 2;
goto emit_reloc;
emit_reloc:
{
/* Indicate dependency to linker. */
char *name[] = { "__aeabi_unwind_cpp_pr0",
"__aeabi_unwind_cpp_pr1",
"__aeabi_unwind_cpp_pr2" };
symbolS *pr = symbol_find_or_make (name[unwind.personality_index]);
fix_new (frag_now, where, 4, pr, 0, 1, BFD_RELOC_NONE);
}
break; break;
default: default:

View File

@ -5,7 +5,10 @@
RELOCATION RECORDS FOR \[.ARM.extab\]: RELOCATION RECORDS FOR \[.ARM.extab\]:
OFFSET TYPE VALUE OFFSET TYPE VALUE
00000000 R_ARM_NONE __aeabi_unwind_cpp_pr1
0000000c R_ARM_PREL31 .text 0000000c R_ARM_PREL31 .text
0000000c R_ARM_NONE __aeabi_unwind_cpp_pr0
0000001c R_ARM_NONE __aeabi_unwind_cpp_pr1
RELOCATION RECORDS FOR \[.ARM.exidx\]: RELOCATION RECORDS FOR \[.ARM.exidx\]: