Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-29 Thread Ilya Leoshkevich via Gcc-patches
On Fri, 2022-04-29 at 13:56 +0200, Jakub Jelinek wrote: > On Fri, Apr 29, 2022 at 01:52:49PM +0200, Ilya Leoshkevich wrote: > > > This doesn't resolve the problem, unfortunately, because > > > references to discarded comdat symbols are still kept in .rodata: > > > > > > `.text._ZN7testing15Asserti

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-29 Thread Jakub Jelinek via Gcc-patches
On Fri, Apr 29, 2022 at 01:52:49PM +0200, Ilya Leoshkevich wrote: > > This doesn't resolve the problem, unfortunately, because > > references to discarded comdat symbols are still kept in .rodata: > > > > `.text._ZN7testing15AssertionResultlsIPKcEERS0_RKT_' referenced in > > section `.rodata' of .

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-29 Thread Ilya Leoshkevich via Gcc-patches
On Thu, 2022-04-28 at 14:05 +0200, Ilya Leoshkevich wrote: > On Thu, 2022-04-28 at 13:27 +0200, Jakub Jelinek wrote: > > On Thu, Apr 28, 2022 at 01:03:26PM +0200, Ilya Leoshkevich wrote: > > > This is determined by default_elf_select_rtx_section ().  If we > > > don't > > > want to mix non-reloc an

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-28 Thread Ilya Leoshkevich via Gcc-patches
On Thu, 2022-04-28 at 13:27 +0200, Jakub Jelinek wrote: > On Thu, Apr 28, 2022 at 01:03:26PM +0200, Ilya Leoshkevich wrote: > > This is determined by default_elf_select_rtx_section ().  If we > > don't > > want to mix non-reloc and reloc constants, we need to define a > > special > > section there.

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-28 Thread Jakub Jelinek via Gcc-patches
On Thu, Apr 28, 2022 at 01:03:26PM +0200, Ilya Leoshkevich wrote: > This is determined by default_elf_select_rtx_section (). If we don't > want to mix non-reloc and reloc constants, we need to define a special > section there. > > It seems to me, however, that this all would be made purely for th

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-28 Thread Ilya Leoshkevich via Gcc-patches
On Wed, 2022-04-27 at 14:46 +0200, Jakub Jelinek wrote: > On Wed, Apr 27, 2022 at 02:23:00PM +0200, Jakub Jelinek wrote: > > On Wed, Apr 27, 2022 at 11:59:49AM +0200, Ilya Leoshkevich wrote: > > > I get a .LASANPC reloc there in the first place because of > > > https://patchwork.ozlabs.org/project/

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Apr 27, 2022 at 02:23:00PM +0200, Jakub Jelinek wrote: > On Wed, Apr 27, 2022 at 11:59:49AM +0200, Ilya Leoshkevich wrote: > > I get a .LASANPC reloc there in the first place because of > > https://patchwork.ozlabs.org/project/gcc/patch/20190702085154.26981-1-...@linux.ibm.com/ > > but of c

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Apr 27, 2022 at 11:59:49AM +0200, Ilya Leoshkevich wrote: > I get a .LASANPC reloc there in the first place because of > https://patchwork.ozlabs.org/project/gcc/patch/20190702085154.26981-1-...@linux.ibm.com/ > but of course it may happen for other reasons as well. In that case I don't se

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-27 Thread Ilya Leoshkevich via Gcc-patches
On Wed, 2022-04-27 at 11:59 +0200, Ilya Leoshkevich via Gcc-patches wrote: > On Wed, 2022-04-27 at 11:33 +0200, Jakub Jelinek wrote: > > On Wed, Apr 27, 2022 at 11:27:49AM +0200, Ilya Leoshkevich via Gcc- > > patches wrote: > > > Bootstrapped and regtested on x86_64-redhat-linux and > > > s390x-red

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-27 Thread Ilya Leoshkevich via Gcc-patches
On Wed, 2022-04-27 at 11:33 +0200, Jakub Jelinek wrote: > On Wed, Apr 27, 2022 at 11:27:49AM +0200, Ilya Leoshkevich via Gcc- > patches wrote: > > Bootstrapped and regtested on x86_64-redhat-linux and > > s390x-redhat-linux.  Ok for master (or GCC 13 in case this doesn't > > fit > > stage4 criteria

Re: [PATCH] Honor COMDAT for mergeable constant sections

2022-04-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Apr 27, 2022 at 11:27:49AM +0200, Ilya Leoshkevich via Gcc-patches wrote: > Bootstrapped and regtested on x86_64-redhat-linux and > s390x-redhat-linux. Ok for master (or GCC 13 in case this doesn't fit > stage4 criteria)? I'd prefer to defer this to GCC 13 at this point. Furthermore, doe

[PATCH] Honor COMDAT for mergeable constant sections

2022-04-27 Thread Ilya Leoshkevich via Gcc-patches
Bootstrapped and regtested on x86_64-redhat-linux and s390x-redhat-linux. Ok for master (or GCC 13 in case this doesn't fit stage4 criteria)? Building C++ template-heavy code with ASan sometimes leads to bogus "defined in discarded section" linker errors. The reason is that .rodata.FUNC.cstN s