The glibc 2.23,2.24,2.25 fails with new binutils 2.29 and above

error:
/tmp/cc1BUce4.s: Assembler messages:
/tmp/cc1BUce4.s: Error: `loc1@GLIBC_2.4' can't be versioned to common symbol 'loc1'
/tmp/cc1BUce4.s: Error: `loc2@GLIBC_2.4' can't be versioned to common symbol 'loc2'
/tmp/cc1BUce4.s: Error: `locs@GLIBC_2.4' can't be versioned to common symbol 'locs'

backporting the patch from glibc 2.26

ref:
https://sourceware.org/bugzilla/show_bug.cgi?id=21661
https://github.com/bminor/glibc/commit/388b4f1a02f3a801965028bbfcd48d905638b797

---
 misc/regexp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/misc/regexp.c b/misc/regexp.c
index 3b36682..b2a2c6e 100644
--- a/misc/regexp.c
+++ b/misc/regexp.c
@@ -29,14 +29,15 @@
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
 
-/* Define the variables used for the interface.  */
-char *loc1;
-char *loc2;
+/* Define the variables used for the interface.  Avoid .symver on common
+   symbol, which just creates a new common symbol, not an alias.  */
+char *loc1 __attribute__ ((nocommon));
+char *loc2 __attribute__ ((nocommon));
 compat_symbol (libc, loc1, loc1, GLIBC_2_0);
 compat_symbol (libc, loc2, loc2, GLIBC_2_0);
 
 /* Although we do not support the use we define this variable as well.  */
-char *locs;
+char *locs __attribute__ ((nocommon));
 compat_symbol (libc, locs, locs, GLIBC_2_0);
 
 
-- 
2.17.1

