This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ELF interposition and One Definition Rule

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]