How to delete unused .CONST data in MASM?

I use macros in MASM to generate about 2,000 functions, for each of which I define a string, but I use only about 30 of them in any given program.

(It is impossible to predict which ones I will use ahead of time, I will use them as needed.)

Is there a way to tell the linker to β€œcross out” lines that I don't use? They blew up a binary size pretty much.

+7
source share
1 answer

Why don't you just put these 2000 functions and strings in a static library? Make procs public and use externdef for strings, then when you link exe to lib, the linker will only pull the strings and procs that are used.

+1
source

All Articles