[rtems-source-builder commit] rtems-bsb: Use linker garbage collection for BSP based builds
Chris Johns
chrisj at rtems.org
Tue Apr 28 08:41:31 UTC 2020
Module: rtems-source-builder
Branch: master
Commit: 13e4dfd3d279693ae7a3a56a00a7b0d88cd26bd1
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=13e4dfd3d279693ae7a3a56a00a7b0d88cd26bd1
Author: Chris Johns <chrisj at rtems.org>
Date: Tue Apr 28 18:34:08 2020 +1000
rtems-bsb: Use linker garbage collection for BSP based builds
Close #3944.
---
rtems/config/rtems-bsp.cfg | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/rtems/config/rtems-bsp.cfg b/rtems/config/rtems-bsp.cfg
index d50615e..801cd5c 100644
--- a/rtems/config/rtems-bsp.cfg
+++ b/rtems/config/rtems-bsp.cfg
@@ -228,10 +228,19 @@
%endif
#
+# Define any extra flags we may need.
+#
+%define rtems_bsp_ldflags_extra \
+ %{?rtems_bsp_ldflags_extra: %{rtems_bsp_ldflags_extra}} \
+ -Wl,--gc-sections
+
+#
# The linker flags need to include the machine options for the BSP.
#
%define mflags_filter awk '{for (i=1;i<NF;++i) if ($i ~ /\-m/) printf("%s ",$i);}'
-%define rtems_bsp_ldflags %{rtems_bsp_ldflags} $(echo "%{rtems_bsp_cflags}" | %{mflags_filter})
+%define rtems_bsp_ldflags %{rtems_bsp_ldflags} \
+ $(echo "%{rtems_bsp_cflags}" | %{mflags_filter}) \
+ %{rtems_bsp_ldflags_extra}
#
# Map to names used for cross compiling.
More information about the vc
mailing list