mbox series

[0/2] Enable Dead Code Elimination

Message ID tencent_A49D2F3ABD9848D0904EE4A6A0BDAC933A06@qq.com
Headers show
Series Enable Dead Code Elimination | expand

Message

Kele Zhang Aug. 24, 2024, 8:14 a.m. UTC
This patch enables `--gc-sections`. Dead Code Elimination (DCE) can
reduce binary size and the attack surface without introducing side
effects, and it has been used in the Linux kernel for many years.

After testing, enabling DCE does not affect the normal functionality of
OpenSBI.

Kele Zhang (2):
  Makefile: enable --gc-sections
  Makefile: Remove -g from default CFLAGS

 Makefile                    | 4 ++--
 firmware/fw_base.ldS        | 1 +
 firmware/fw_payload.elf.ldS | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)