OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/1] Enable Dead Code Elimination
@ 2024-10-01 23:05 Kele Zhang
  2024-10-01 23:05 ` [PATCH v4 1/1] Makefile: enable --gc-sections Kele Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Kele Zhang @ 2024-10-01 23:05 UTC (permalink / raw)
  To: opensbi

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.

---
v1: https://lists.infradead.org/pipermail/opensbi/2024-August/007286.html
v2: https://lists.infradead.org/pipermail/opensbi/2024-August/007301.html
v3: https://lists.infradead.org/pipermail/opensbi/2024-September/007344.html
---
Changes in v2:
- Move --gc-sections to ELFFLAGS
- Remove redundant KEEP()

Changes in v3:
- Move --print-gc-sections to ifneq ($(DEBUG),)
- Move "ifneq ($(DEBUG),)" to the latter part of the Makefile, ensuring
that "ELFFLAGS  +=      $(USE_LD_FLAG)" remains at the beginning.

Changes in v4:
- fix: replace spaces with tabs for consistent indentation
---

Kele Zhang (1):
  Makefile: enable --gc-sections

 Makefile             | 15 +++++++++------
 firmware/fw_base.ldS |  1 +
 2 files changed, 10 insertions(+), 6 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-06 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 23:05 [PATCH v4 0/1] Enable Dead Code Elimination Kele Zhang
2024-10-01 23:05 ` [PATCH v4 1/1] Makefile: enable --gc-sections Kele Zhang
2024-10-04  0:55   ` Xiang W
2024-11-06 11:06   ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox