[cooker] Why ICF and GC-sections are enabled ?

Hi,

our linkers (ld.bfd, ld.lld) by default uses ICF and gc-sections

1. gc-sections
This works only when -ffunction-sections is passed during compilation, and
its GCC specific.
Makes no sense to enable LD --gc-sections when our default %optflags does
not emit -ffunction-sections -fdata-sections

2. ICF
Same as above, without -ffunction-sections -fdata-sections in optflags it
make no sense

3. Unsafe ?
We are the only ones who enabled ICF and gc-section in gold and LLD. I
really wonder if these uncommon options gives any advantage these days.

WDYT ?

Worth to mention is that -ffunction-sections -fdata-sections were good in
times where LTO was not available.

wt., 24 wrz 2019, 23:49 użytkownik Tomasz Gajc <tpgxyz@gmail.com> napisał: