Fixes a bug in the relaxation of R_MSP430X_ABS16 to R_MSP430_10_PCREL.
authorNick Clifton <nickc@redhat.com>
Thu, 15 Jan 2015 16:20:19 +0000 (16:20 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 15 Jan 2015 16:20:19 +0000 (16:20 +0000)
* elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
relocs.  Include PC-relative adjustment for R_MSP430X_ABS16
relaxation.

bfd/ChangeLog
bfd/elf32-msp430.c

index d0542826c39fbdbe4d609f141d604d12d74820d3..3a2d6f605a2f1733c2b5b544fbaa82b6a3f4942a 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-15  Nick Clifton  <nickc@redhat.com>
+
+       * elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
+       relocs.  Include PC-relative adjustment for R_MSP430X_ABS16
+       relaxation.
+
 2015-01-15  Alan Modra  <amodra@gmail.com>
 
        * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
index 2157eb0c5d0eeb75089e4cd2a37d23810abd6fee..3a1c0a1c10440654b4abb15ef051fb57a3d5aa3e 100644 (file)
@@ -1921,7 +1921,7 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,
        default:
          /* Not a conditional branch instruction.  */
          /* fprintf (stderr, "unrecog: %x\n", opcode); */
-         goto error_return;
+         continue;
        }
 
       /* Note that we've changed the relocs, section contents, etc.  */
@@ -2162,6 +2162,7 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,
          {
            bfd_vma value = symval;
 
+           value -= (sec->output_section->vma + sec->output_offset);
            value -= irel->r_offset;
            value += irel->r_addend;