Can someone here tell me if there is something similar to LD_PRELOAD on recent versions of AIX? More specifically I need to intercept calls from my binary to time(), returning a constant time, for testing purposes.
LD_PRELOAD on AIX
aixtesting
aixtesting
Can someone here tell me if there is something similar to LD_PRELOAD on recent versions of AIX? More specifically I need to intercept calls from my binary to time(), returning a constant time, for testing purposes.
Best Solution
AIX 5.3 introduced the
LDR_PRELOAD
(for 32-bit programs) andLDR_PRELOAD64
(for 64-bit programs) variables. They are analoguous to LD_PRELOAD on Linux. Both are colon-separated lists of libraries, and symbols will be pre-emptively loaded from the listed shared objects before anything else.For example, if you have a shared object foo.so:
If you use archives, use the AIX style to specify the object within the archive:
And separate multiple entries with a colon: