public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>,
	Jeff Law <jeffreyalaw@gmail.com>, "H.J. Lu" <hjl.tools@gmail.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] varasm, v3: Handle private COMDAT function symbol reference in readonly data section [PR113617]
Date: Thu, 1 Feb 2024 09:23:07 +0100	[thread overview]
Message-ID: <ZbtU6/+peIXCHNuN@tucnak> (raw)
In-Reply-To: <ZbqYarChjvEzdof6@tucnak>

On Wed, Jan 31, 2024 at 07:58:50PM +0100, Jakub Jelinek wrote:
> On Wed, Jan 31, 2024 at 07:11:20PM +0100, Jakub Jelinek wrote:
> > On Wed, Jan 31, 2024 at 09:39:12AM -0800, H.J. Lu wrote:
> > > GNU binutils has no issues with it:
> > 
> > I know, I meant gcc.
> > So, it seems get_section handles section purely by name lookup
> > and isn't prepared to deal with multiple different sections
> > of the same name, but different comdat group.
> > 
> > Thus, maybe at least temporarily we need to use unique
> > section names here, say
> > .data.rel.ro.local.pool.<comdat_name>
> > .data.rel.ro.pool.<comdat_name>
> > .rodata.pool.<comdat_name>
> > where <comdat_name> would be the name of the comdat group, i.e.
> > IDENTIFIER_POINTER (DECL_COMDAT_GROUP (decl))
> 
> Here is an untested patch which implements that:
> 
> 2024-01-31  Jakub Jelinek  <jakub@redhat.com>
> 	    H.J. Lu  <hjl.tools@gmail.com>
> 
> 	PR rtl-optimization/113617
> 	* varasm.cc (default_elf_select_rtx_section): For
> 	references to private symbols in comdat sections
> 	use .data.relro.local.pool.<comdat>, .data.relro.pool.<comdat>
> 	or .rodata.<comdat> comdat sections.
> 
> 	* g++.dg/other/pr113617.C: New test.
> 	* g++.dg/other/pr113617.h: New test.
> 	* g++.dg/other/pr113617-aux.cc: New test.

Bootstrapped/regtested on x86_64-linux and i686-linux successfully,
ok for trunk?

	Jakub


  reply	other threads:[~2024-02-01  8:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31  2:21 [PATCH v2] Handle private COMDAT function symbol reference in readonly data section H.J. Lu
2024-01-31 16:30 ` Jakub Jelinek
2024-01-31 16:48   ` H.J. Lu
2024-01-31 17:09     ` Jakub Jelinek
2024-01-31 17:39       ` H.J. Lu
2024-01-31 18:11         ` Jakub Jelinek
2024-01-31 18:58           ` [PATCH] varasm, v3: Handle private COMDAT function symbol reference in readonly data section [PR113617] Jakub Jelinek
2024-02-01  8:23             ` Jakub Jelinek [this message]
2024-01-31 19:31           ` [PATCH v2] Handle private COMDAT function symbol reference in readonly data section H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZbtU6/+peIXCHNuN@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).