MN10330: Do not use linker relaxation and incremental linking together

Nick Clifton
Tue Jun 28 14:47:00 GMT 2011

Hi Guys,

  With the MN10300, enabling linker relaxation when performing a
  incremental link does not work:

    % mn10300-elf-gcc hello.c -mrelax -r
    collect-ld: --relax and -r may not be used together
    collect2: error: ld returned 1 exit status

  Hence I am applying the patch below as an obvious fix for the problem.
  Tested without regressions on an mn10300-elf toolchain.


2011-06-28  Nick Clifton  <>

	* config/mn10300/mn10300.h (LINK_SPEC): Do not use linker
	relaxation when performing an incremental link.

Index: gcc/config/mn10300/mn10300.h
--- gcc/config/mn10300/mn10300.h	(revision 175576)
+++ gcc/config/mn10300/mn10300.h	(working copy)
@@ -24,7 +24,7 @@
 #undef LIB_SPEC
 #undef  LINK_SPEC
-#define LINK_SPEC "%{mrelax:--relax}"
+#define LINK_SPEC "%{mrelax:%{!r:--relax}}"
 #define STARTFILE_SPEC "%{!mno-crt0:%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}"

More information about the Gcc-patches mailing list