https://sourceware.org/bugzilla/show_bug.cgi?id=25315
--- Comment #6 from dave.anglin at bell dot net --- On 2019-12-26 8:35 p.m., amodra at gmail dot com wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=25315 > > --- Comment #5 from Alan Modra <amodra at gmail dot com> --- > Oh, wait a minute. Why are there references to a local symbol in a comdat > section? That just seems odd. The linker will keep just one of the multiple > copies of the comdat section but there normally isn't any translation of a > local symbol in one discarded comdat section to the equivalent local symbol in > the kept section. Locals are local after all. This has to be a gcc problem. > This is how gcc sets up the decl for __tcf_0 start_cleanup_fn (void) { char name[32]; tree fntype; tree fndecl; bool use_cxa_atexit = flag_use_cxa_atexit && !targetm.cxx.use_atexit_for_cxa_atexit (); push_to_top_level (); /* No need to mangle this. */ push_lang_context (lang_name_c); /* Build the name of the function. */ sprintf (name, "__tcf_%d", start_cleanup_cnt++); /* Build the function declaration. */ fntype = TREE_TYPE (get_atexit_fn_ptr_type ()); fndecl = build_lang_decl (FUNCTION_DECL, get_identifier (name), fntype); /* It's a function with internal linkage, generated by the compiler. */ TREE_PUBLIC (fndecl) = 0; DECL_ARTIFICIAL (fndecl) = 1; /* Make the function `inline' so that it is only emitted if it is actually needed. It is unlikely that it will be inlined, since it is only called via a function pointer, but we avoid unnecessary emissions this way. */ DECL_DECLARED_INLINE_P (fndecl) = 1; DECL_INTERFACE_KNOWN (fndecl) = 1; The TREE_PUBLIC line makes the symbol local but the comment says it should have internal linkage. -- You are receiving this mail because: You are on the CC list for the bug.