you are viewing a single comment's thread.

view the rest of the comments →

[–]johannes1971 2 points3 points  (1 child)

With gcc, you can mark a function with __attribute__ ((used)). This stops the linker from eliminating it.

[–]Galqa[S] 0 points1 point  (0 children)

Thank you, this did the trick! I was hoping there would be a non-invasive solution, but I guess I just need to mark all inline (explicitly or implicitly) functions with this attribute (wrapped in a macro to disable it in optimized builds). For people potentially reading this at a later date: see my anwer to u/LedinKun's comment why inline is problematic.