RTEMS: Fix default linker script
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Mon, 25 Jan 2021 11:29:05 +0000 (12:29 +0100)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Mon, 25 Jan 2021 11:31:23 +0000 (12:31 +0100)
We have to use ENDFILE_SPEC for the default linker script and not
STARTFILE_SPEC, since STARTFILE_SPEC is place before the user provided
library search paths.

gcc/

* config/rtems.h (STARTFILE_SPEC): Remove qnolinkcmds.
(ENDFILE_SPEC): Evaluate qnolinkcmds.

gcc/config/rtems.h

index e5cba75d34530922c8ffc1c4394d143918232d14..313988d89e5bb70ae3dc65935fd20c52eed2de95 100644 (file)
  */
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC "%{!qrtems:crt0%O%s} " \
-"%{qrtems:" RTEMS_STARTFILE_SPEC " %{!qnolinkcmds:-T linkcmds%s}}"
+"%{qrtems:" RTEMS_STARTFILE_SPEC "}"
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
-"%{qrtems:" RTEMS_ENDFILE_SPEC "}"
+"%{qrtems:" RTEMS_ENDFILE_SPEC " %{!qnolinkcmds:-T linkcmds%s}}"
 
 /*
  * Some targets do not set up LIB_SPECS, override it, here.