https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96217
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The division and modulo functions in glibc are built with -fexceptions (since r190483 it seems), so I guess you don't really want to build them with -O0, because in that case you might end up with some _Unwind_Resume, __gcc_personality_v0 etc. not optimized away like it happened to you. You'd need to link with -lgcc_eh to get those, as it is not in -lgcc (intentionally) or -shared-libgcc.