in reply to [OT] Abusing GNU compiler and linker: Make the linker generate an array of function pointers

Using Perlmonks as a rubber duck ... ;-)

All that I need is a way to tell the linker to stop cleaning up my precious section. Shouldn't be that hard, right?

It isn't that hard. Just tell the linker to KEEP records in my section. Exactly as it is done by default for constructor functions. D'oh!

Now my plan works.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: [OT] Abusing GNU compiler and linker: Make the linker generate an array of function pointers
  • Download Code