Re: In need of help to understand the program behaviour while loading shared libraries and at linking time.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Now, my assumption was that at runtime, this constructor will be called
> before any resolutions have been made to the functions that I have defined
> in this library. For example, let's say that I was intercepting the
> *ioctl *function.

I'll assume your question is about GNU/Linux and therefore glibc.

That is not how this works.  Relocation completes for all objects, and
only then ELF constructors are invoked.  This two-pass approach is
necessary because otherwise, it would be more likely that unrelocated
code is executed if symbol interposition or underlinking is in play.

If you want to run your own code before relocation processing, you
should look at LD_AUDIT and audit modules.  The Solaris documentation
mostly applies to glibc as well, at least as far as the basics are
concerned.

Thanks,
Florian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux