https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102426
--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > So, shouldn't we instead of the -export-symbols-regex use a version script? We certainly could, but IIUC this would lose the functionality on non-ELF targets that do support -export-symbols-regex in a different way. No idea if this is deemed acceptable... > We have it in multiple lib* directories, so presumably it should work > reliably. > Say the version script in libssp/ is quite simple, small configure.ac hunk, > small Makefile.am hunk, small version script. We could even simplify the libssp example: given that we only want to export one single symbol, we don't need the make_sunver.pl magic, only the difference between -Wl,--version-script and -Wl,-M. Just in case you wonder, we still need that script for libssp on Solaris: mempcpy and thus __mempcpy_chk don't exist on Solaris, thus that symbol needs to be filtered from ssp.map. I long meant to unify all those instances of version script handling, but that turned out to be a terrible can of worms and is certainly not GCC 12 material.