Mail Archives: djgpp/2000/09/30/10:58:39
Hi all.
--- "Salvador I. Ducros" <sducros AT home DOT com> 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/
- Raw text -