Ian Lance Taylor wrote: > Robert Wohlrab <robert.wohlrab@xxxxxx> writes: > > I have the problem that I have a shared object which is mostly c with a > > relative small part C++. It is compiled with -fvisibility=hidden and only > > some small parts are exported. I noticed today that non-exported C++ > > symbols were also exported. This is quite mysterious because they are 5 > > functions from templates (looks related to std::vector with allocator > > stuff to me). The shared object is generated by source files from > > mupen64plus-core (can be found on bitbucket) using `make -C > > projects/unix/ all`. > > > > Is there any way to disable that symbols? The vector is not used outside > > that shared object and the interface of the shared object should be as > > clean as possible. I tried already with -fvisibility-inlines-hidden but > > without success. > > In general this should not happen. Can you provide a small standalone > test case which shows the problem? I am not sure what the problem really is - so it is a little bit hard to make a test case. I tried to create one by stripping of some files and functions. It also includes a debian directory because I used dpkg-gensymbols to check for exported symbols. debian/libtest0.symbols says that no function is exported (I wrote it because it is what the source says - it is not autogenerated), but dpkg-gensymbols will then report that 5 other functions were exported by libtest.so.0. The Makefile says that visibility is hidden and the test.cpp doesn't say that anything should be exported. As far as I know dpkg-gensymbols uses `objdump -T` do generate a list of exported functions. See debian/control for a list of symbols it reports. In my tests I just `tar xvf test_0.tar.gz && cd test-0 && debuild` I tested it using binutils-gold and normal binutils, but that doesn't seem to change anything. -- Robert Wohlrab
Attachment:
test_0.tar.gz
Description: application/compressed-tar