* config/tc-i386.c (md_estimate_size_before_relax) Don't lose

reloc when no_cond_jump_promotion.
This commit is contained in:
Alan Modra 2002-05-09 06:35:22 +00:00
parent 4a335f3dc2
commit 412167cbaa
2 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2002-05-09 Alan Modra <amodra@bigpond.net.au>
* config/tc-i386.c (md_estimate_size_before_relax) Don't lose
reloc when no_cond_jump_promotion.
2002-05-08 Jim Wilson <wilson@redhat.com> 2002-05-08 Jim Wilson <wilson@redhat.com>
* config/tc-i960.c (md_estimate_size_before_relax): Return size of * config/tc-i960.c (md_estimate_size_before_relax): Return size of

View File

@ -4235,10 +4235,8 @@ md_estimate_size_before_relax (fragP, segment)
break; break;
case COND_JUMP86: case COND_JUMP86:
if (no_cond_jump_promotion) if (size == 2
goto relax_guess; && (!no_cond_jump_promotion || fragP->fr_var != NO_RELOC))
if (size == 2)
{ {
/* Negate the condition, and branch past an /* Negate the condition, and branch past an
unconditional jump. */ unconditional jump. */
@ -4258,8 +4256,15 @@ md_estimate_size_before_relax (fragP, segment)
/* Fall through. */ /* Fall through. */
case COND_JUMP: case COND_JUMP:
if (no_cond_jump_promotion) if (no_cond_jump_promotion && fragP->fr_var == NO_RELOC)
goto relax_guess; {
fragP->fr_fix += 1;
fix_new (fragP, old_fr_fix, 1,
fragP->fr_symbol,
fragP->fr_offset, 1,
BFD_RELOC_8_PCREL);
break;
}
/* This changes the byte-displacement jump 0x7N /* This changes the byte-displacement jump 0x7N
to the (d)word-displacement jump 0x0f,0x8N. */ to the (d)word-displacement jump 0x0f,0x8N. */
@ -4281,7 +4286,6 @@ md_estimate_size_before_relax (fragP, segment)
return fragP->fr_fix - old_fr_fix; return fragP->fr_fix - old_fr_fix;
} }
relax_guess:
/* Guess size depending on current relax state. Initially the relax /* Guess size depending on current relax state. Initially the relax
state will correspond to a short jump and we return 1, because state will correspond to a short jump and we return 1, because
the variable part of the frag (the branch offset) is one byte the variable part of the frag (the branch offset) is one byte