aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-09 06:35:22 +0000
committerAlan Modra <amodra@gmail.com>2002-05-09 06:35:22 +0000
commit412167cbaa214b161aec426ee4fe424e31fc766e (patch)
tree60dbea3dfa22b5d209609a2e18f75c98cc3b0afd /gas/config
parent4a335f3dc276c211d64af46d748291ad53087023 (diff)
downloadgdb-412167cbaa214b161aec426ee4fe424e31fc766e.zip
gdb-412167cbaa214b161aec426ee4fe424e31fc766e.tar.gz
gdb-412167cbaa214b161aec426ee4fe424e31fc766e.tar.bz2
* config/tc-i386.c (md_estimate_size_before_relax) Don't lose
reloc when no_cond_jump_promotion.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index bb1d512..f681014 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4235,10 +4235,8 @@ md_estimate_size_before_relax (fragP, segment)
break;
case COND_JUMP86:
- if (no_cond_jump_promotion)
- goto relax_guess;
-
- if (size == 2)
+ if (size == 2
+ && (!no_cond_jump_promotion || fragP->fr_var != NO_RELOC))
{
/* Negate the condition, and branch past an
unconditional jump. */
@@ -4258,8 +4256,15 @@ md_estimate_size_before_relax (fragP, segment)
/* Fall through. */
case COND_JUMP:
- if (no_cond_jump_promotion)
- goto relax_guess;
+ if (no_cond_jump_promotion && fragP->fr_var == NO_RELOC)
+ {
+ 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
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;
}
- relax_guess:
/* Guess size depending on current relax state. Initially the relax
state will correspond to a short jump and we return 1, because
the variable part of the frag (the branch offset) is one byte