This is the mail archive of the
mailing list for the GCC project.
Re: GCC target_clone support (functionality question)
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Evgeny Stupachenko <evstupac at gmail dot com>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, GCC mailing list <gcc at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, Uros Bizjak <ubizjak at gmail dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Richard Biener <rguenther at suse dot de>, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Earnshaw <richard dot earnshaw at arm dot com>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Nick Clifton <nickc at redhat dot com>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Jeff Law <law at redhat dot com>, Hartmut Penner <hepenner at us dot ibm dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Andreas Krebbel <Andreas dot Krebbel at de dot ibm dot com>
- Date: Fri, 5 May 2017 15:48:20 -0400
- Subject: Re: GCC target_clone support (functionality question)
- Authentication-results: sourceware.org; auth=none
- References: <20170505181859.GA11428@ibm-tiger.the-meissners.org> <20170505184530.GA15560@ibm-tiger.the-meissners.org> <CAOvf_xzMMbbQ+adZ+hWYtxACn_6yS50nhhcVYeBuPnUKZNPc2g@mail.gmail.com>
On Fri, May 05, 2017 at 12:32:03PM -0700, Evgeny Stupachenko wrote:
> Hi Michael,
> On Fri, May 5, 2017 at 11:45 AM, Michael Meissner
> <email@example.com> wrote:
> > This message is separated from the question about moving code, as it is a
> > questions about the functionality of target_clone support.
> > Right now it looks like target_clone only generates the ifunc handler if there
> > is a call to the function in the object file. It does not generate the ifunc
> > handler if there is no call.
> > For the default function, it generates the normal name. This means that any
> > function that calls the function from a different object module will only get
> > the standard function. From a library and user perspective, I think this is
> > wrong. Instead the default function should be generated with a different name,
> > and the ifunc function should list the standard name. Then you don't have to
> > change all of the other calls in the object file, the normal ifunc handling
> > will handle it. It also means you can more easily put this function in a
> > library and automatically call the appropriate version.
> I think library issue could be resolved using special headers. You can
> look into GLIBC, there should be similar technique.
> When you call resolver from initial (default) function, you make an
> assumption that ifunc is supported.
Yes, ifunc should be required before you even consider using target_clone.
What I'm trying to do is make it easier for people to add target clones to
their code, but not having to go through using special headers or other gunk.
I want them to be able to add just the target clone line, and everything will
work. That means in the current case, the default case should be renamed to
<function>.default, and what is <function>.ifunc should become <function>.
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: firstname.lastname@example.org, phone: +1 (978) 899-4797