[PATCH v3 1/1] Makefile: enable --gc-sections

Bin Meng bmeng.cn at gmail.com
Wed Sep 11 09:59:25 PDT 2024


On Thu, Sep 5, 2024 at 5:31 PM Kele Zhang <zhangcola2003 at gmail.com> wrote:
>
> The --gc-sections option enables the linker to perform garbage
> collection of unreferenced code and data, thereby reducing the binary
> size.
>
> The -ffunction-sections option will place each function into a separate
> section, so it is necessary to add .text.* to the linker script.
>
> Signed-off-by: Kele Zhang <zhangcola2003 at gmail.com>
> Signed-off-by: Yuan Tan <tanyuan at tinylab.org>
> Signed-off-by: Zhangjin Wu <falcon at tinylab.org>
> ---
>  Makefile             | 15 +++++++++------
>  firmware/fw_base.ldS |  1 +
>  2 files changed, 10 insertions(+), 6 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>



More information about the opensbi mailing list