This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] bfd: PC-relative jump for MSP430


bfd/
	* elf32-msp430.c (msp430_elf_relax_section):
	The MSP430 and MSP430X both support 10bit PC-relative jump.
	Ref: SLAU144J.pdf section 3.4.3 Jumps.
	Changed the condition that applies the optimisation.
---
 bfd/elf32-msp430.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index 9fae015..75a6288 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -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;
 
-- 
2.10.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]