Skip to content

Commit

Permalink
Add a linker branch optimization for the MSP430.
Browse files Browse the repository at this point in the history
	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.
  • Loading branch information
Benjamin Green authored and nickclifton committed Jul 25, 2017
1 parent ec06425 commit cfe7b9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions bfd/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2017-07-25 Benjamin Green <[email protected]>

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 <[email protected]>

* elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
Expand Down
4 changes: 2 additions & 2 deletions bfd/elf32-msp430.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cfe7b9b

Please sign in to comment.