bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/21824] MSP430 relative PC 10-bit optimisation


From: bengreen5mx at gmail dot com
Subject: [Bug ld/21824] MSP430 relative PC 10-bit optimisation
Date: Tue, 25 Jul 2017 11:34:34 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21824

Benjamin Green <bengreen5mx at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |---

--- Comment #3 from Benjamin Green <bengreen5mx at gmail dot com> ---
My patch does not check the relocation types with uses_msp430x_relocs.

Sorry.

---
 bfd/elf32-msp430.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index 75a6288..1a7d2e0 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -2227,8 +2227,10 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,

        /* Try to turn a 16-bit absolute branch into a 10-bit pc-relative
           branch.  */
-       if (ELF32_R_TYPE (irel->r_info) == R_MSP430X_ABS16
-           || ELF32_R_TYPE (irel->r_info) == R_MSP430_16)
+       if ((uses_msp430x_relocs (abfd)
+           && ELF32_R_TYPE (irel->r_info) == R_MSP430X_ABS16)
+           || (! uses_msp430x_relocs (abfd)
+           && ELF32_R_TYPE (irel->r_info) == R_MSP430_16))
          {
            bfd_vma value = symval;

--
2.10.2

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]