Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LD_PRELOAD on AIX

Tags:

aix

testing

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.

like image 234
Arlaharen Avatar asked Aug 31 '26 21:08

Arlaharen


1 Answers

AIX 5.3 introduced the LDR_PRELOAD (for 32-bit programs) and LDR_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:

 LDR_PRELOAD=foo.so

If you use archives, use the AIX style to specify the object within the archive:

 LDR_PRELOAD="bar.a(shr.so)"

And separate multiple entries with a colon:

 LDR_PRELOAD="foo.so:bar.a(shr.so)"
like image 128
Ville Laurikari Avatar answered Sep 03 '26 14:09

Ville Laurikari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!