Add a linker branch optimization for the MSP430.
authorBenjamin Green <bengreen5mx@gmail.com>
Tue, 25 Jul 2017 08:41:23 +0000 (09:41 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 25 Jul 2017 08:41:23 +0000 (09:41 +0100)
PR 21824
* elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
16-bit absolute branches into 10-bit pc-relative branches on the
MSP430 as well as the MSP430X.

bfd/ChangeLog
bfd/elf32-msp430.c

index d224022c2efe28744ec03bd2d158651180544eee..aacae0f9a531d058adecb3176744350590c525e0 100644 (file)
@@ -1,3 +1,10 @@
+2017-07-25  Benjamin Green  <bengreen5mx@gmail.com>
+
+       PR 21824
+       * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
+       16-bit absolute branches into 10-bit pc-relative branches on the
+       MSP430 as well as the MSP430X.
+
 2017-07-25  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
index 9fae01573e39326a2e7efa7751f8c54fe3b768ab..75a6288a32ae3b56e19bf5c73545f19d01445965 100644 (file)
@@ -2227,8 +2227,8 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,
 
        /* Try to turn a 16-bit absolute branch into a 10-bit pc-relative
           branch.  */
-       if (uses_msp430x_relocs (abfd)
-           && ELF32_R_TYPE (irel->r_info) == R_MSP430X_ABS16)
+       if (ELF32_R_TYPE (irel->r_info) == R_MSP430X_ABS16
+           || ELF32_R_TYPE (irel->r_info) == R_MSP430_16)
          {
            bfd_vma value = symval;
 
This page took 0.029616 seconds and 4 git commands to generate.