>You can believe what you like about the idea.  Until you are willing
>to implement something *you* believe will help, or at the least
>explain how you forsee it being done safely (which Microsoft
>doesn't!), it's very hard to take you seriously

As I've already said, it can be made safe by communicating to the linker
which functions have had their address taken.  Yes, this requires special
support from the linker, but then so has linkonce on some platforms.
If that special support isn't available you're still left with an unsafe
but very useful optimization for applications that don't compare function
pointers.

Please go away and stop trolling.

If your concern is function pointers or global functions, you can
never eliminate any global function, unless your application doesn't
call dlopen, or otherwise load anything dynamically, including through
shared libs.
This is true with or without "linker support".
It is always a whole-program optimization for global functions,
because they always escape.

If your concern is function pointers with escaping static functions,
or static functions whose address is otherwise taken, you can detect
this in module trivially, so why would you communicate this to the
linker, instead of doing the optimization in the compiler.

Doing it in the linker buys you no safety whatsoever, as there is
nothing the linker can detect that the compiler cannot without the
linker analyzing code to see whether the escaping function is actually
used in a comparison.  This is equivalent to teaching your compiler to
do link time optimization, which a much better strategy.

This will be my last post on this thread. If you don't like the
optimization, don't use it. But certainly, doing it in the linker
doesn't make it any safer.  You are simply on crack if you believe it
does.

HTH,
Dan

Reply via email to