Can I use function-level linking to eliminate dead code from NASM object files when linking with Microsoft's linker, and if so how do I go about using it? Similarly is there an equivalent of -ffunction-sections/-fdata-sections when linking with GCC?
You see I'm working on a graphics library for which a suite of macros generate a combinatorial explosion of code, little of which a single user will ever need. Not surprisingly this scheme is unmaintainable in the long run if we want to continue adding further blitter functions, bitmap formats and processor specializations.
And having the compiler eliminate dead code seems like the most straightforward solution to the problem, because as far as I can tell the only alternatives are to split up everything into lots and lots of object files or attempt to do runtime code generation.
Frankly I don't know how function-level linking really works and information on the subject seems to be scarce. I would think that separating everything into unique segments, together with the normal symbol references in the object format, ought to provide the linker with enough information to prune dead code. But I fear there's more to it, for one thing Microsoft 's tools tries to merge identical function as well.
/doynax