On Tue, Aug 26, 2014 at 11:09:05AM +0200, Martin Husemann wrote: > On Mon, Aug 25, 2014 at 08:40:53PM +0000, Joerg Sonnenberger wrote: > > Module Name: src > > Committed By: joerg > > Date: Mon Aug 25 20:40:53 UTC 2014 > [..] > > Log Message: > > Add basic support for indirect functions. It allows providing a public > > function symbol with an implementation choosen at run time. > > This obvisouly wasn't even compile tested and not discussed anywhere.
It was compile and runtime tested on a number of platforms. Looks like I just didn't hit enough... > Why is this a good idea? What is it going to be used for? > > This all sounds like a very, very evil hack to me. Why would you want to > do something like this during runtime linking (instead of in the source > itself where you may understand security and other implications)? It can be used to provide different implementations in one library based on hardware support etc, without adding an additional layer of indirection like the function pointer dance we do in src/common for the atomics. It also makes it possible to move symbols from one DSO to another without breaking the ABI if the old location uses symbol versioning. That's the original motivation here -- to be able to gut libgcc_s.so without requiring the major bump. Joerg