On Mon, Mar 7, 2011 at 12:18 PM, Muli Ben-Yehuda <[email protected]> wrote:
> On Mon, Mar 07, 2011 at 12:11:36PM +0200, Erez D wrote: > > > I have a function which is not called in a regular way, so gcc > > thinks it is dead code. however it is not, and i am looking for a > > way to tell the linker not to remove it. > > extern > > > And set the function pointer to a global variable, so that the linker cannot know if the value is used or not. This trick I learned from Nadav Har'El worked through many compilers and linkers over the past decade. > _______________________________________________ > Linux-il mailing list > [email protected] > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il > -- Orna Agmon Ben-Yehuda. http://ladypine.org
_______________________________________________ Linux-il mailing list [email protected] http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
