This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Re: Does -gc-section (garbage collection) works only with static linking ?


Hi again Nick,

> Your code could call a dynamic library function and pass to that
> function a pointer to another function inside your application.  This
> second function does not have to be exported, since it is your code that
> computes its address, but nevertheless the function can be accessed from
> outside of your code.  Think of the atexit() function supported by the C
> library as an example of this.

Sorry if I bother you, but how this situation differs from the static link
case ? Would the linker remove such function with static linking ?

(i386 Intel syntax)

mov eax,myfxptr
...
call [eax]    // in user's program

Does GCC compiler tells the linker in this case that myfx is called ?

Best regards,
Valery



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]