+2019-10-25  Alan Modra  <amodra@gmail.com>
+
+       PR gas/25125
+       PR gas/12049
+       * write.c (relax_frag): Correct calculation of delta for
+       positive branches where "stretch" would make the branch
+       negative.  Return zero immediately in that case.  Correct
+       TC_PCREL_ADJUST comment.
+
 2019-10-16  Alan Modra  <amodra@gmail.com>
 
        * config/tc-xtensa.c (xg_order_trampoline_chain_entry): Don't
 
   const relax_typeS *table;
 
   target = fragP->fr_offset;
-  address = fragP->fr_address;
+  address = fragP->fr_address + fragP->fr_fix;
   table = TC_GENERIC_RELAX_TABLE;
   this_state = fragP->fr_subtype;
   start_type = this_type = table + this_state;
             negative.  Don't allow this in case the negative reach is
             large enough to require a larger branch instruction.  */
          else if (target < address)
-           target = fragP->fr_next->fr_address + stretch;
+           return 0;
        }
     }
 
-  aim = target - address - fragP->fr_fix;
+  aim = target - address;
 #ifdef TC_PCREL_ADJUST
-  /* Currently only the ns32k family needs this.  */
+  /* Currently only the ns32k and arc needs this.  */
   aim += TC_PCREL_ADJUST (fragP);
 #endif