LD_PRELOAD does not work as expected

后端 未结 3 1640
我在风中等你
我在风中等你 2020-12-30 22:05

Consider the following library which can be preloaded before any program execution:

// g++ -std=c++11 -shared -fPIC preload.cpp -o preload.so
// LD_PRELOAD=.         


        
3条回答
  •  没有蜡笔的小新
    2020-12-30 22:26

    If the program exits via _exit (POSIX) or _Exit (C99) or abnormal program termination (abort, fatal signals, etc.) then there's no way destructors could be called. I don't see any way around this.

提交回复
热议问题