https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110069
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org --- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> --- For such space-constrained environments I'd suggest using '-pg' instead. It emits just one call to the _mcount function on entry without overhead. If you need to hook the exit, you can replace the return address in your implementation of _mcount (this function usually has a non-standard ABI, so it's always necessary to implement it in assembly).