* config/tc-i386.c (md_estimate_size_before_relax) Don't lose
authorAlan Modra <amodra@gmail.com>
Thu, 9 May 2002 06:35:22 +0000 (06:35 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 9 May 2002 06:35:22 +0000 (06:35 +0000)
reloc when no_cond_jump_promotion.

gas/ChangeLog
gas/config/tc-i386.c

index b8c14237f91e5d7c22ffe393ab2bce3d6c8622e5..097e548b58ed710c86586cb66533d70e32630087 100644 (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>
 
        * config/tc-i960.c (md_estimate_size_before_relax): Return size of
index bb1d512c77b6b311b4d73b960d2a91a506fb10bf..f681014e278acb00624c40b87a855f28f466361e 100644 (file)
@@ -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