summaryrefslogtreecommitdiff
path: root/gcc/config/msp430/msp430.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/msp430/msp430.h')
-rw-r--r--gcc/config/msp430/msp430.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/config/msp430/msp430.h b/gcc/config/msp430/msp430.h
index 0ea6b0a093e..7b94918a55d 100644
--- a/gcc/config/msp430/msp430.h
+++ b/gcc/config/msp430/msp430.h
@@ -44,13 +44,20 @@ extern bool msp430x;
} \
while (0)
+/* For the "c" language where exceptions are implicitly disabled, use
+ crt*_no_eh.o unless -fexceptions is passed. For other languages, only use
+ crt*_no_eh.o if -fno-exceptions is explicitly passed. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{pg:gcrt0.o%s}" \
- "%{!pg:%{minrt:crt0-minrt.o%s}%{!minrt:crt0.o%s}} %{!minrt:crtbegin.o%s}"
+ "%{!pg:%{minrt:crt0-minrt.o%s}%{!minrt:crt0.o%s}} " \
+ "%{!minrt:%{,c:%{!fexceptions:crtbegin_no_eh.o%s; :crtbegin.o%s}; " \
+ ":%{fno-exceptions:crtbegin_no_eh.o%s; :crtbegin.o%s}}}"
/* -lgcc is included because crtend.o needs __mspabi_func_epilog_1. */
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "%{!minrt:crtend.o%s} " \
+#define ENDFILE_SPEC \
+ "%{!minrt:%{,c:%{!fexceptions:crtend_no_eh.o%s; :crtend.o%s}; " \
+ ":%{fno-exceptions:crtend_no_eh.o%s; :crtend.o%s}}} " \
"%{minrt:%:if-exists(crtn-minrt.o%s)}%{!minrt:%:if-exists(crtn.o%s)} -lgcc"
#define ASM_SPEC "-mP " /* Enable polymorphic instructions. */ \