What is the LD_PRELOAD trick?

前端 未结 9 1174
攒了一身酷
攒了一身酷 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:08

    With LD_PRELOAD you can give libraries precedence.

    For example you can write a library which implement malloc and free. And by loading these with LD_PRELOAD your malloc and free will be executed rather than the standard ones.

提交回复
热议问题