]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
xtensa: fix gas trampolines regression
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 9 May 2015 22:02:31 +0000 (01:02 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Wed, 13 May 2015 16:25:52 +0000 (19:25 +0300)
Extra condition 'abs (addr - trampaddr) < J_RANGE / 2' for trampoline
selection results in regressions: when relaxable jump is little longer
than J_RANGE so that single trampoline makes two new jumps, one longer
than J_RANGE / 2 and one shorter, correct trampoline cannot be found.

Drop that condition.

2015-05-13  Max Filippov  <jcmvbkbc@gmail.com>
gas/
* config/tc-xtensa.c (xtensa_relax_frag): Allow trampoline to be
closer than J_RANGE / 2 to jump frag.

gas/testsuite/
* gas/xtensa/trampoline.s: Add regression testcase.

gas/ChangeLog
gas/config/tc-xtensa.c
gas/testsuite/ChangeLog
gas/testsuite/gas/xtensa/trampoline.s

index 48775387ed8d54d6fa665c87647737da30ce8efa..683a30ed3248f16fbbbe86767849ac21cdc2622f 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-13  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * config/tc-xtensa.c (xtensa_relax_frag): Allow trampoline to be
+       closer than J_RANGE / 2 to jump frag.
+
 2015-05-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        * configure.tgt (arch): Set to iamcu for i386-*-elfiamcu target.
index b1827fa9a3e815f5b5a14a0a327de35bca28d1f8..31c0b6be7eea1d0d80289e843244418a4cf475f8 100644 (file)
@@ -9071,8 +9071,7 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
 
              trampaddr = fragP->fr_address + fragP->fr_fix;
 
-             if ((addr + J_RANGE < trampaddr) ||
-                 abs (addr - trampaddr) < J_RANGE / 2)
+             if (addr + J_RANGE < trampaddr)
                continue;
              if (addr > trampaddr + J_RANGE)
                break;
index 793b329ceaa2e1b6f928759f55007b8d095dc75a..5f3f43dbd0919ed59a9ff65b47ddd8b2a3d07908 100644 (file)
@@ -1,3 +1,7 @@
+2015-05-13  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * gas/xtensa/trampoline.s: Add regression testcase.
+
 2015-05-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/i386.exp: Run iamcu-1, iamcu-2, iamcu-3, iamcu-inval-1,
index 4465786bb06d0b6c544b97fbd2066cb5fec1ad57..3cfbe97991abc72ccbd4bc306c5c35472977b7b6 100644 (file)
        .endr
 4:
        j       4b
+
+5:
+       j       6f
+
+       .rep    43691
+       _nop
+       .endr
+
+6:
+       j       5b