https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102426
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to r...@cebitec.uni-bielefeld.de from comment #8) > > --- 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... The world doesn't end if other symbols are exported, it worked that way for years. Perhaps we could test in configure whether -export-symbols-regex works and only use a fallback if it doesn't? Or decide it based on target triplet, do those GNU and SUN version script checks and if neither of them works, fall back to -export-symbols-regex ? gld supports version scripts like: { global: onload; local: *; }; which makes onload a non-versioned GLOBAL symbol while everything else LOCAL, does Sun ld support that too or similar?