+2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/21661
+ * config/obj-elf.c (obj_elf_symver): Don't allow .symver with
+ common symbol.
+ (elf_frob_symbol): Likewise.
+ * testsuite/gas/elf/elf.exp: Run pr21661.
+ * testsuite/gas/elf/pr21661.d: New file.
+ * testsuite/gas/elf/pr21661.s: Likewise.
+
2017-06-26 Nick Clifton <nickc@redhat.com>
* config/tc-arm.c (fpu_any): Only define for ELF based targets.
c = get_symbol_name (& name);
lex_type[(unsigned char) '@'] = old_lexat;
+ if (S_IS_COMMON (sym))
+ {
+ as_bad (_("`%s' can't be versioned to common symbol '%s'"),
+ name, S_GET_NAME (sym));
+ ignore_rest_of_line ();
+ return;
+ }
+
if (symbol_get_obj (sym)->versioned_name == NULL)
{
symbol_get_obj (sym)->versioned_name = xstrdup (name);
symp2 = symbol_find_or_make (sy_obj->versioned_name);
/* Now we act as though we saw symp2 = sym. */
+ if (S_IS_COMMON (symp))
+ {
+ as_bad (_("`%s' can't be versioned to common symbol '%s'"),
+ sy_obj->versioned_name, S_GET_NAME (symp));
+ *puntp = TRUE;
+ return;
+ }
S_SET_SEGMENT (symp2, S_GET_SEGMENT (symp));
--- /dev/null
+[^:]*: Assembler messages:
+[^:]*:2: Error: `foo@VERS.1' can't be versioned to common symbol 'foo'
+[^:]*: Error: `bar@VERS.1' can't be versioned to common symbol 'bar'