From 1781a04fcc32c710b4bcd9080d8e1d7462ca3226 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 19 Apr 2018 10:42:52 +0200 Subject: [PATCH] Do not bail out for multiple PREVAILING_DEF_IRONLY for common symbols. 2018-04-19 Martin Liska * lto-symtab.c (lto_symtab_resolve_symbols): Do not bail out for multiple PREVAILING_DEF_IRONLY for common symbols. From-SVN: r259490 --- gcc/lto/ChangeLog | 5 +++++ gcc/lto/lto-symtab.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 3c6af8f7d16..821a462fb87 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2018-04-19 Martin Liska + + * lto-symtab.c (lto_symtab_resolve_symbols): Do not bail out + for multiple PREVAILING_DEF_IRONLY for common symbols. + 2018-04-18 Martin Liska * lto.c (lto_read_decls): Fix GNU coding style and typos. diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 2660542300e..3663ab7a9b2 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -466,9 +466,14 @@ lto_symtab_resolve_symbols (symtab_node *first) /* If the chain is already resolved there is nothing else to do. */ if (prevailing) { - /* Assert it's the only one. */ + /* Assert it's the only one. + GCC should silence multiple PREVAILING_DEF_IRONLY defs error + on COMMON symbols since it isn't error. + See: https://sourceware.org/bugzilla/show_bug.cgi?id=23079. */ for (e = prevailing->next_sharing_asm_name; e; e = e->next_sharing_asm_name) if (lto_symtab_symbol_p (e) + && !DECL_COMMON (prevailing->decl) + && !DECL_COMMON (e->decl) && (e->resolution == LDPR_PREVAILING_DEF_IRONLY || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP || e->resolution == LDPR_PREVAILING_DEF)) -- 2.30.2