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)? > > I'd prefer to defer this to GCC 13 at this point. > Furthermore, does the linker then actually merge the constants with > the same constants from other mergeable linkonce sections or other > mergeable sections? I'm afraid it would only merge constants within > each comdat group and not across the whole ELF object. > > Jakub >
I experimented with this a little, and actually having a reloc prevents merging altogether (the check happens in _bfd_add_merge_section). 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.