17.2.13 Keep Function Attribute

The keep attribute will prevent the linker from removing the function when the --gc-sections option has been issued, even if that function is unused. For example:
void __attribute__((keep)) foo(void);