Message-ID: <20000930145803.69765.qmail@web9907.mail.yahoo.com> Date: Sat, 30 Sep 2000 07:58:03 -0700 (PDT) From: Lets Go Canes Subject: Re: question about linker behaviour To: djgpp AT delorie DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Reply-To: djgpp AT delorie DOT com Hi all. --- "Salvador I. Ducros" wrote: > My question is basically whether or not the linker (let's say > the DJGPP linker specifically) will include a function from a static > library into an executable if: > > 1. the address of the function is assigned to some function pointer You need go no further. In order to assign the address of the function to the pointer, you (or rather the linker) needs to know the address of the function. You can't know the address of the function if you haven't loaded it from the static library. Basically, the question isn't whether or not the function is called, the question is whether or not it is referenced. Assigning the address of the function to the pointer references it. OTOH, if the functions are in a dynamic library, whether or not the function gets loaded by assigning its address to a pointer will depend on the implementation of the dynamic loader. But I would expect most would not actually load the code until the function was called. ===== -------------- Lets Go Canes! __________________________________________________ Do You Yahoo!? Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free! http://photos.yahoo.com/