declaring external dependency only if symbol is used

Started by vid, May 28, 2007, 08:18:53 PM

Previous topic - Next topic

vid

hi, i'm solving same problem as mentioned here for NASM: http://www.asmcommunity.net/board/index.php?topic=25983

I need to create library header. Library exports some procedures and data. In header, I declare procedures using "PROTO" and symbols using "EXTERN symb:NEAR".

But I want only symbols which are actually used, to be listed as external dependency in object file. Otherwise unused stuff gets linked in.

PROTO works just like i want, no problem there. But EXTERN creates dependency even when symbol is not used.

Is there some way to declare external data, that only creates dependency if it is used?

thanks in advance

vid

Maybe it is somehow possible to declare such symbol as inline macro, and when it is referenced for first time, macro declares external dependency.

Would this be possible?

drizz

The truth cannot be learned ... it can only be recognized.