aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog16
-rw-r--r--ld/Makefile.am5
-rw-r--r--ld/Makefile.in6
-rw-r--r--ld/NEWS2
-rw-r--r--ld/configure.tgt2
-rw-r--r--ld/emulparams/msp430all.sh9
-rw-r--r--ld/emultempl/generic.em12
-rw-r--r--ld/ldmain.c8
-rw-r--r--ld/ldmain.h12
-rw-r--r--ld/scripttempl/elf32msp430.sc138
-rw-r--r--ld/scripttempl/elf32msp430_3.sc16
-rw-r--r--ld/testsuite/ChangeLog12
-rw-r--r--ld/testsuite/ld-elf/flags1.d4
-rw-r--r--ld/testsuite/ld-elf/init-fini-arrays.d5
-rw-r--r--ld/testsuite/ld-elf/merge.d2
-rw-r--r--ld/testsuite/ld-elf/sec64k.exp1
-rw-r--r--ld/testsuite/ld-gc/pr13683.d2
-rw-r--r--ld/testsuite/ld-srec/srec.exp8
-rw-r--r--ld/testsuite/ld-undefined/undefined.exp5
19 files changed, 212 insertions, 53 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 62dd025..5bb24f9 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,19 @@
+2013-05-02 Nick Clifton <nickc@redhat.com>
+
+ * Makefile.am: Add emsp430X.c
+ * Makefine.in: Regenerate.
+ * configure.tgt (msp430): Add msp430X emulation.
+ * ldmain.c (multiple_definition): Only disable relaxation if it
+ was enabled by the user.
+ * ldmain.h (RELAXATION_ENABLED_BY_USER): New macro.
+ * emulparams/msp430all.sh: Add support for MSP430X.
+ * emultempl/generic.em: (before_parse): Enable relaxation for the
+ MSP430.
+ * scripttempl/msp430.sc: Reorganize sections. Add .rodata
+ section.
+ * scripttempl/msp430_3.sc: Likewise.
+ * NEWS: Mention support for MSP430X.
+
2013-05-01 Maciej W. Rozycki <macro@codesourcery.com>
* configure.tgt: Replace alpha*-*-linuxecoff* pattern with
diff --git a/ld/Makefile.am b/ld/Makefile.am
index e0366f3..0eba8a9 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -424,6 +424,7 @@ ALL_EMULATION_SOURCES = \
emsp430xW423.c \
emsp430xW425.c \
emsp430xW427.c \
+ emsp430X.c \
enews.c \
ens32knbsd.c \
eor32.c \
@@ -1773,6 +1774,10 @@ emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
+emsp430X.c: $(srcdir)/emulparams/msp430all.sh \
+ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430X "$(tdir_msp430X)" msp430all
enews.c: $(srcdir)/emulparams/news.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} news "$(tdir_news)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 042e9f2..9140c73 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -732,6 +732,7 @@ ALL_EMULATION_SOURCES = \
emsp430xW423.c \
emsp430xW425.c \
emsp430xW427.c \
+ emsp430X.c \
enews.c \
ens32knbsd.c \
eor32.c \
@@ -1343,6 +1344,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emmo.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emn10200.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emn10300.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emsp430X.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emsp430x110.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emsp430x1101.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emsp430x1111.Po@am__quote@
@@ -3259,6 +3261,10 @@ emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
+emsp430X.c: $(srcdir)/emulparams/msp430all.sh \
+ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430X "$(tdir_msp430X)" msp430all
enews.c: $(srcdir)/emulparams/news.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} news "$(tdir_news)"
diff --git a/ld/NEWS b/ld/NEWS
index 5217e4c..fa11d2d 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -1,5 +1,7 @@
-*- text -*-
+* Add support for the Texas Instruments MSP430X processor.
+
* Add support for Altera Nios II.
* Add support for the V850E3V5 architecture.
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 8d7aec4..5694580 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -519,7 +519,7 @@ mn10300-*-*) targ_emul=mn10300
mt-*elf) targ_emul=elf32mt
;;
msp430-*-*) targ_emul=msp430x110
- targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449"
+ targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449 msp430X"
;;
nios2*-*-*) targ_emul=nios2elf ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
diff --git a/ld/emulparams/msp430all.sh b/ld/emulparams/msp430all.sh
index 57d21c2..3a2f79d 100644
--- a/ld/emulparams/msp430all.sh
+++ b/ld/emulparams/msp430all.sh
@@ -551,3 +551,12 @@ RAM_START=0x0200
RAM_SIZE=0x400
STACK=0x600
fi
+
+if [ "${MSP430_NAME}" = "msp430X" ] ; then
+ARCH=msp:43
+ROM_START=0x02000
+ROM_SIZE=0x0dfe0
+RAM_START=0x10000
+RAM_SIZE=0x30000
+STACK=0x600
+fi
diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em
index 20ec356..dce2bff 100644
--- a/ld/emultempl/generic.em
+++ b/ld/emultempl/generic.em
@@ -57,6 +57,18 @@ gld${EMULATION_NAME}_before_parse (void)
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
+EOF
+ # The MSP430 port *needs* linker relaxtion in order to cope with large
+ # functions where conditional branches do not fit into a +/- 1024 byte range.
+ case ${target} in
+ msp430-*-* )
+fragment <<EOF
+ if (! link_info.relocatable)
+ TARGET_ENABLE_RELAXATION;
+EOF
+ ;;
+ esac
+fragment <<EOF
}
EOF
diff --git a/ld/ldmain.c b/ld/ldmain.c
index c23c554..20d8920 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -1,7 +1,5 @@
/* Main program of GNU linker.
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright 1991-2013 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of the GNU Binutils.
@@ -953,10 +951,10 @@ multiple_definition (struct bfd_link_info *info,
if (obfd != NULL)
einfo (_("%D: first defined here\n"), obfd, osec, oval);
- if (RELAXATION_ENABLED)
+ if (RELAXATION_ENABLED_BY_USER)
{
einfo (_("%P: Disabling relaxation: it will not work with multiple definitions\n"));
- link_info.disable_target_specific_optimizations = -1;
+ DISABLE_RELAXATION;
}
return TRUE;
diff --git a/ld/ldmain.h b/ld/ldmain.h
index 69928f8..90558a1 100644
--- a/ld/ldmain.h
+++ b/ld/ldmain.h
@@ -1,6 +1,5 @@
/* ldmain.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002, 2003, 2004,
- 2005, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
+ Copyright 1991-2013 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
@@ -42,11 +41,16 @@ extern int overflow_cutoff_limit;
#define RELAXATION_DISABLED_BY_DEFAULT \
(link_info.disable_target_specific_optimizations < 0)
#define RELAXATION_DISABLED_BY_USER \
- (link_info.disable_target_specific_optimizations > 0)
+ (link_info.disable_target_specific_optimizations > 1)
#define RELAXATION_ENABLED \
+ (link_info.disable_target_specific_optimizations == 0 \
+ || link_info.disable_target_specific_optimizations == 1)
+#define RELAXATION_ENABLED_BY_USER \
(link_info.disable_target_specific_optimizations == 0)
-#define DISABLE_RELAXATION \
+#define TARGET_ENABLE_RELAXATION \
do { link_info.disable_target_specific_optimizations = 1; } while (0)
+#define DISABLE_RELAXATION \
+ do { link_info.disable_target_specific_optimizations = 2; } while (0)
#define ENABLE_RELAXATION \
do { link_info.disable_target_specific_optimizations = 0; } while (0)
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index 53a87b8..c699a91 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -35,6 +35,31 @@ MEMORY
SECTIONS
{
+ /* Bootloader. */
+ .bootloader ${RELOCATING-0} :
+ {
+ ${RELOCATING+ PROVIDE (__boot_start = .) ; }
+ *(.bootloader)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.bootloader.*)
+ } ${RELOCATING+ > bootloader}
+
+ /* Information memory. */
+ .infomem ${RELOCATING-0} :
+ {
+ *(.infomem)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.infomem.*)
+ } ${RELOCATING+ > infomem}
+
+ /* Information memory (not loaded into MPU). */
+ .infomemnobits ${RELOCATING-0} :
+ {
+ *(.infomemnobits)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.infomemnobits.*)
+ } ${RELOCATING+ > infomemnobits}
+
/* Read-only sections, merged into text segment. */
${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) }
@@ -122,6 +147,8 @@ SECTIONS
*(.text)
${RELOCATING+. = ALIGN(2);}
*(.text.*)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.text:*)
${RELOCATING+. = ALIGN(2);}
*(SORT_NONE(.fini9))
@@ -139,42 +166,84 @@ SECTIONS
_etext = .;
} ${RELOCATING+ > text}
- .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
+ .rodata :
+ {
+ . = ALIGN(2);
+ *(.plt)
+ *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
+ *(.rodata1)
+
+ *(.eh_frame_hdr)
+ KEEP (*(.eh_frame))
+
+ KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
+
+ PROVIDE (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE (__preinit_array_end = .);
+
+ PROVIDE (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE (__init_array_end = .);
+
+ PROVIDE (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE (__fini_array_end = .);
+ LONG(0); /* Sentinel. */
+
+ /* gcc uses crtbegin.o to find the start of the constructors, so
+ we make sure it is first. Because this is a wildcard, it
+ doesn't matter if the user does not actually link against
+ crtbegin.o; the linker won't look for a file to match a
+ wildcard. The wildcard also means that it doesn't matter which
+ directory crtbegin.o is in. */
+ KEEP (*crtbegin*.o(.ctors))
+
+ /* We don't want to include the .ctor section from from the
+ crtend.o file until after the sorted ctors. The .ctor section
+ from the crtend file contains the end of ctors marker and it
+ must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ } ${RELOCATING+ > text}
+
+ .vectors ${RELOCATING-0}:
+ {
+ ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
+ *(.vectors*)
+ ${RELOCATING+ _vectors_end = . ; }
+ } ${RELOCATING+ > vectors}
+
+ .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text) + SIZEOF (.rodata))}
{
${RELOCATING+ PROVIDE (__data_start = .) ; }
+ ${RELOCATING+ PROVIDE (__datastart = .) ; }
${RELOCATING+. = ALIGN(2);}
+
+ KEEP (*(.jcr))
+ *(.data.rel.ro.local) *(.data.rel.ro*)
+ *(.dynamic)
+
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
+ KEEP (*(.gnu.linkonce.d.*personality*))
+ *(.data1)
+ *(.got.plt) *(.got)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > data}
- /* Bootloader. */
- .bootloader ${RELOCATING-0} :
- {
- ${RELOCATING+ PROVIDE (__boot_start = .) ; }
- *(.bootloader)
- ${RELOCATING+. = ALIGN(2);}
- *(.bootloader.*)
- } ${RELOCATING+ > bootloader}
-
- /* Information memory. */
- .infomem ${RELOCATING-0} :
- {
- *(.infomem)
- ${RELOCATING+. = ALIGN(2);}
- *(.infomem.*)
- } ${RELOCATING+ > infomem}
-
- /* Information memory (not loaded into MPU). */
- .infomemnobits ${RELOCATING-0} :
- {
- *(.infomemnobits)
- ${RELOCATING+. = ALIGN(2);}
- *(.infomemnobits.*)
- } ${RELOCATING+ > infomemnobits}
-
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
${RELOCATING+. = ALIGN(2);}
@@ -194,13 +263,6 @@ SECTIONS
${RELOCATING+ _end = . ; }
} ${RELOCATING+ > data}
- .vectors ${RELOCATING-0}:
- {
- ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
- *(.vectors*)
- ${RELOCATING+ _vectors_end = . ; }
- } ${RELOCATING+ > vectors}
-
${HEAP_SECTION_MSP430}
/* Stabs for profiling information*/
@@ -214,12 +276,18 @@ SECTIONS
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
-
EOF
-. $srcdir/scripttempl/DWARF.sc
+source $srcdir/scripttempl/DWARF.sc
cat <<EOF
+ .MP430.attributes 0 :
+ {
+ KEEP (*(.MSP430.attributes))
+ KEEP (*(.gnu.attributes))
+ KEEP (*(__TI_build_attributes))
+ }
+
PROVIDE (__stack = ${STACK}) ;
PROVIDE (__data_start_rom = _etext) ;
PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
diff --git a/ld/scripttempl/elf32msp430_3.sc b/ld/scripttempl/elf32msp430_3.sc
index 9a23d02..ade5fcb 100644
--- a/ld/scripttempl/elf32msp430_3.sc
+++ b/ld/scripttempl/elf32msp430_3.sc
@@ -98,6 +98,8 @@ SECTIONS
*(.text)
${RELOCATING+. = ALIGN(2);}
*(.text.*)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.text:*)
${RELOCATING+. = ALIGN(2);}
*(SORT_NONE(.fini9))
@@ -115,6 +117,13 @@ SECTIONS
${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > text}
+ .rodata :
+ {
+ *(.rodata .rodata.* .gnu.linkonce.r.*)
+ *(.const)
+ *(.const:*)
+ } ${RELOCATING+ > text}
+
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{
${RELOCATING+ PROVIDE (__data_start = .) ; }
@@ -152,6 +161,13 @@ SECTIONS
${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors}
+ .MP430.attributes 0 :
+ {
+ KEEP (*(.MSP430.attributes))
+ KEEP (*(.gnu.attributes))
+ KEEP (*(__TI_build_attributes))
+ }
+
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 664b33e..7b2e506 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2013-05-02 Nick Clifton <nickc@redhat.com>
+
+ * ld-elf/flags1.d: Expect this test to pass on the MSP430.
+ * ld-elf/init-fini-arrays.d: Expect this test to fail on the
+ MSP430.
+ * ld-elf/merge.d: Expect this test to pass on the MSP430.
+ * ld-elf/sec64k.exp: Skip these tests for the MSP430.
+ * ld-gc/pr13683.d: Expect this test to fail on the MSP430.
+ * ld-srec/srec.exp: Expect these tests to fail on the MSP430.
+ * ld-undefined/undefined.exp: Expect the UNDEFINED LINE test to
+ fail on the MSP430.
+
2013-05-01 Maciej W. Rozycki <macro@codesourcery.com>
* lib/ld-lib.exp (check_shared_lib_support): Also exclude
diff --git a/ld/testsuite/ld-elf/flags1.d b/ld/testsuite/ld-elf/flags1.d
index ab8facc..63c2e3a 100644
--- a/ld/testsuite/ld-elf/flags1.d
+++ b/ld/testsuite/ld-elf/flags1.d
@@ -3,9 +3,9 @@
#objcopy_linked_file: --set-section-flags .post_text_reserve=contents,alloc,load,readonly,code
#readelf: -l --wide
#xfail: "avr-*-*" "dlx-*-*" "h8300-*-*" "i960-*-*" "ip2k-*-*" "m32r-*-*"
-#xfail: "moxie-*-*" "mt-*-*" "msp430-*-*" "*-*-nacl*"
+#xfail: "moxie-*-*" "mt-*-*" "*-*-nacl*"
#xfail: "*-*-hpux*" "hppa*64*-*-*"
-# Fails on the AVR, DLX, H8300, I960, IP2K, M32R, MOXIE, MT, and MSP430,
+# Fails on the AVR, DLX, H8300, I960, IP2K, M32R, MOXIE, MT,
# and all NaCl targets,
# because the two sections are not merged into one segment.
# (There is no good reason why they have to be).
diff --git a/ld/testsuite/ld-elf/init-fini-arrays.d b/ld/testsuite/ld-elf/init-fini-arrays.d
index 1b182b9..46b536c 100644
--- a/ld/testsuite/ld-elf/init-fini-arrays.d
+++ b/ld/testsuite/ld-elf/init-fini-arrays.d
@@ -1,9 +1,10 @@
#source: init-fini-arrays.s
#ld: -r
#readelf: -S --wide
-#xfail: cr16-*-* crx-*-*
+#xfail: cr16-*-* crx-*-* msp430-*-*
+# msp430 puts the init_array and fini_array inside the .rodata section.
# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
+# well with unique group sections under ld -r.
#...
\[[ 0-9]+\] \.init_array\.01000[ \t]+PROGBITS[ \t0-9a-f]+WA?.*
diff --git a/ld/testsuite/ld-elf/merge.d b/ld/testsuite/ld-elf/merge.d
index 3593f96..c50de10 100644
--- a/ld/testsuite/ld-elf/merge.d
+++ b/ld/testsuite/ld-elf/merge.d
@@ -4,7 +4,7 @@
#xfail: "arc-*-*" "avr-*-*" "bfin-*-*" "cr16-*-*" "cris*-*-*" "crx-*-*" "d10v-*-*" "d30v-*-*"
#xfail: "dlx-*-*" "fr30-*-*" "frv-*-*" "hppa*64*-*-*" "h8300-*-*" "score-*-*"
#xfail: "i370-*-*" "i860-*-*" "i960-*-*" "ip2k-*-*" "iq2000-*-*" "lm32-*-*"
-#xfail: "mcore-*-*" "mn102*-*-*" "mips*-*-*" "ms1-*-*" "msp430-*-*" "mep-*-*"
+#xfail: "mcore-*-*" "mn102*-*-*" "mips*-*-*" "ms1-*-*" "mep-*-*"
#xfail: "or32-*-*" "pj-*-*" "sparc*-*-*" "tic6x-*-*" "vax-*-*" "xstormy16-*-*"
#xfail: "xtensa*-*-*" "metag-*-*"
diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp
index 7c04c9b..7c9f292 100644
--- a/ld/testsuite/ld-elf/sec64k.exp
+++ b/ld/testsuite/ld-elf/sec64k.exp
@@ -34,6 +34,7 @@ if { [istarget "arc-*-*"]
|| [istarget "d30v-*-*"]
|| [istarget "dlx-*-*"]
|| [istarget "i960-*-*"]
+ || [istarget "msp430*-*-*"]
|| [istarget "or32-*-*"]
|| [istarget "pj*-*-*"]
|| [istarget "m32r-*-*"] } {
diff --git a/ld/testsuite/ld-gc/pr13683.d b/ld/testsuite/ld-gc/pr13683.d
index 19b2598..b38b9d1 100644
--- a/ld/testsuite/ld-gc/pr13683.d
+++ b/ld/testsuite/ld-gc/pr13683.d
@@ -2,7 +2,7 @@
#source: dummy.s
#ld: --gc-sections -e main --defsym foo=foo2 tmpdir/pr13683.o
#nm: --format=bsd
-#xfail: sh64*-*-* iq2000-*-* lm32-*-* epiphany-*-* mips64vr-*-* frv-*-* m32c-*-* rl78-*-* rx-*-* sh-*-* powerpc*-*-eabivle
+#xfail: sh64*-*-* iq2000-*-* lm32-*-* epiphany-*-* mips64vr-*-* frv-*-* m32c-*-* rl78-*-* rx-*-* sh-*-* powerpc*-*-eabivle msp430-*-*
# Note - look for both "foo" and "foo2" being defined, non-zero function symbols
diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp
index 001fb2e..4a433d1 100644
--- a/ld/testsuite/ld-srec/srec.exp
+++ b/ld/testsuite/ld-srec/srec.exp
@@ -1,7 +1,6 @@
# Test linking directly to S-records.
# By Ian Lance Taylor, Cygnus Support.
-# Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2011, 2012
-# Free Software Foundation, Inc.
+# Copyright 1999-2013 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
@@ -269,6 +268,11 @@ proc run_srec_test { test objs } {
set flags "$flags -no-relax"
}
+ # MSP430 targets always relax.
+ if [istarget msp430*-*-*] {
+ setup_xfail "msp430*-*-*"
+ }
+
# Epiphany needs some help too
if [istarget epiphany*-*-*] {
set flags "$flags --defsym _start=00000060"
diff --git a/ld/testsuite/ld-undefined/undefined.exp b/ld/testsuite/ld-undefined/undefined.exp
index 65fbc4b..49af737 100644
--- a/ld/testsuite/ld-undefined/undefined.exp
+++ b/ld/testsuite/ld-undefined/undefined.exp
@@ -128,6 +128,11 @@ setup_xfail mcore-*-elf
setup_xfail mep-*-*
setup_xfail mips-sgi-irix6*
setup_xfail "sh64-*-*"
+# Fails for the MSP430 because it uses SYM_DIFF relocs but it does
+# not provide a special_function for handling them. If optimization
+# is enabled then this test passes because function()'s prologue is
+# eliminated.
+setup_xfail "msp430-*-*"
# The undefined test fails on 31 bit s/390 because the address of the
# function `this_function_is_not_defined' is stored in the literal pool of