test,static-destruct: Use retain attribute to prevent linker garbage collection

Fixes: #21847
This commit is contained in:
Jan Janssen
2021-12-22 12:14:08 +09:00
committed by Yu Watanabe
parent 8470a16d6f
commit a3aff1c47f
4 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_lis
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \
_section_("SYSTEMD_BUS_ERROR_MAP") \
_used_ \
__attribute__((retain)) \
_retain_ \
_alignptr_ \
_variable_no_sanitize_address_