Is there a .def file equivalent on Linux for controlling exported function names in a shared library?

后端 未结 4 800
独厮守ぢ
独厮守ぢ 2021-01-31 12:04

I am building a shared library on Ubuntu 9.10. I want to export only a subset of my functions from the library. On the Windows platform, this would be done using a module defini

4条回答
  •  情歌与酒
    2021-01-31 12:14

    How can I restrict the exported functions of a shared library to those I want (i.e. a .def file equivalent)

    Perhaps you're looking for GNU Export Maps or Symbol Versioning

    g++ -shared spaceship.cpp -o libspaceship.so.1 -Wl,-soname=libspaceship.so.1 -Wl, --version-script=spaceship.expmap

提交回复
热议问题