GCC 9-2019-q4 removed debug information from TF-M veneer called functions


When building the TF-M (https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/)  during the build process it creates _veneer functions for the functions that will be called from a NS Context to the Secure context, to they provide the SG functionality. Link to the template in the code: https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/secure_fw/spm/cmsis_func/tfm_veneers.c.template 

This construction seems to confuse the linker, as it removes the debug information for the function called by the funcion_veneer function, but the function itself is kept, so the application runs as expected just the debug symbols are getting discarded by the linker. 

By adding the linker argument "-Wl,--undefined=function" it will keep the debug information, but that looks more like a workaround than fixing the actual root cause.

Does anybody have any idea what could cause the linker to remove these functions called by the veneer functions, could this be cause by the SG functionality of the _veneer functions?