This is the mail archive of the
mailing list for the GCC project.
Re: ELF interposition and One Definition Rule
- From: Nathan Sidwell <nathan at acm dot org>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Nathan Sidwell <nathan_sidwell at mentor dot com>, Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Nathan Sidwell <nathan at codesourcery dot com>, Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Date: Wed, 04 Sep 2013 07:02:46 +0100
- Subject: Re: ELF interposition and One Definition Rule
- Authentication-results: sourceware.org; auth=none
- References: <20130826152141 dot GA19918 at kam dot mff dot cuni dot cz> <521BF9C1 dot 8080806 at redhat dot com> <521CA12C dot 9090604 at mentor dot com> <CAFiYyc0P7nTjLjWEwiNB9nPpM5Dy55GN6OZ1G9Nam1exFjHKxQ at mail dot gmail dot com> <20130828115211 dot GA11901 at kam dot mff dot cuni dot cz>
On 08/28/13 12:52, Jan Hubicka wrote:
What is really important for backend is that it is not defined what happens
when you compare addresses of those functions (based on fact that youcan't take
it, as for ctors/dtors, or compare it, as for virtual functions). If backend
also knows that they are not interposable, it knows it can freely duplicate
or unify their bodies when it seems win.
I think this is the wrong test. It's true that at the language level, these
things don't have addresses. But someone trying to use interposition is not
working at that level -- they're working at the ELF level (for sake of picking a
binary format). At that level, these things do have addresses, just like any
other (non-inlined) function.
I know of a case where users have expected interposition of member functions to
work (ugly though that is). I can't recall whether ctors/dtors or vfuncs were
the functions of interest, but that's not really the point. At the binary
level, these are just regular functions.