https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98860
--- Comment #41 from Jakub Jelinek <jakub at gcc dot gnu.org> --- gcc/configure has e.g. $ld_vers_major and $ld_vers_minor and $ld_vers_patch. But as the fix was March 1st, I think it is neither in 2.35.2 nor in 2.36. I think a feature test would be better, try to assemble as short assembly as possible with the new DWARF5 sections in it (with the actual code perhaps replaced just by a nop), link it and look at it using objdump if the sections are right or not?