https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126841
--- Comment #8 from Longjun Luo <luolongjuna at gmail dot com> --- Patch posted: https://inbox.sourceware.org/gcc-patches/[email protected]/ The fix clears implicit section names on the renamed symbol and its aliases in privatize_symbol_name_1, so that LTRANS regenerates them from the final assembler name. Explicit user-specified section names are left unchanged. It also documents in invoke.texi that, under LTO, an implicitly generated section name is derived from the final assembler name. The regression test covers both cases reported here: three identically named internal-linkage functions each get their own section, and the exported function keeps the unsuffixed section. Tested on x86_64-pc-linux-gnu. The test fails without the change and passes with it, and the complete gcc.dg/lto and g++.dg/lto suites show no unexpected results.
