The GNU ld option --no-undefined-version is defined as follows:
Normally when a symbol has an undefined version, the linker will ignore it. This option disallows symbols with undefined version and a fatal error will be issued instead.
Description in not very clear in my opinion about what it should do.
Fortunately, Ian Lance Tailor leaved a message in binutils maillist
(https://sourceware.org/ml/binutils/2010-01/msg00092.html)
From there:
"what the option actually does is this:
For each version defined in a version script:
for each global symbol pattern in that version listed in the script: if the pattern is a literal string--not a wildcard pattern: if the pattern does not match any symbol defined in the link: give an error.
In other words, the option does not check for symbols with undefined
versions. It checks for cases where a version script explicitly lists
a symbol, but the symbol is not defined."
Patch implements that behavior. This fixes PR27448.
Please change the error message to be the same as gold. I think gold's error message is better.