mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-10 15:24:09 +01:00
fa1c12453b
LLD 13 and GNU ld 2.37 support -z start-stop-gc which allows garbage collection of C identifier name sections despite the __start_/__stop_ references. GNU ld before 2015-10 had the behavior as well. Simply set the retain attribute so that GCC 11 (if configure-time binutils is 2.36 or newer)/Clang 13 will set the SHF_GNU_RETAIN section attribute to prevent garbage collection. Without the patch, there are linker errors with -z start-stop-gc (LLD default) when -Wl,--gc-sections is used: ``` ld.lld: error: undefined symbol: __start___eap >>> referenced by eap.c >>> src/eap.o:(eap_init) ``` The remain attribute will not be needed if the metadata sections are referenced by code directly.