mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
Makefile: enable --gc-sections
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@gmail.com> Signed-off-by: Yuan Tan <tanyuan@tinylab.org> Signed-off-by: Zhangjin Wu <falcon@tinylab.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
PROVIDE(_text_start = .);
|
||||
*(.entry)
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
. = ALIGN(8);
|
||||
PROVIDE(_text_end = .);
|
||||
}
|
||||
|
Reference in New Issue
Block a user