[PATCH] Use linker garbage collection for BSP based builds

Chris Johns chrisj at rtems.org
Tue Apr 14 07:02:35 UTC 2020


On 14/4/20 4:57 pm, Sebastian Huber wrote:
> Close #3944.
> ---
>   rtems/config/rtems-bsp.cfg | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rtems/config/rtems-bsp.cfg b/rtems/config/rtems-bsp.cfg
> index d50615e..91296b1 100644
> --- a/rtems/config/rtems-bsp.cfg
> +++ b/rtems/config/rtems-bsp.cfg
> @@ -231,7 +231,7 @@
>   # 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}) -Wl,--gc-sections

What about adding a define like ..

%define rtems_bsp_ldflags_extra -Wl,--gc-sections

.. or something like that and then adding it to rtems_bsp_ldflags?

It would make it easier to track.

Chris


More information about the devel mailing list