What is the LD_PRELOAD trick?

前端 未结 9 1189
攒了一身酷
攒了一身酷 2020-11-21 07:27

I came across a reference to it recently on proggit and (as of now) it is not explained.

I suspect this might be it, but I don\'t know for sure.

9条回答
  •  梦谈多话
    2020-11-21 08:03

    LD_PRELOAD lists shared libraries with functions that override the standard set, just as /etc/ld.so.preload does. These are implemented by the loader /lib/ld-linux.so. If you want to override just a few selected functions, you can do this by creating an overriding object file and setting LD_PRELOAD; the functions in this object file will override just those functions leaving others as they were.

    For more information on shared libraries visit http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

提交回复
热议问题