Description
On Linux, a typical rust ELF dynamic library will export every symbol on earth, e.g.:
objdump -T ~/projects/goblin/target/debug/libgoblin.so | wc -l
2558
which looks like most of core
and std
, e.g.:
107680 _ZN4core3num52_$LT$impl$u20$core..str..FromStr$u20$for$u20$u16$GT$8from_str17he60266b17184e647E (114)
Why not do this? Well, it's just The Right Thing To Do ™️ but also, technically it unnecessarily increases the size of the binary by adding dynamic symbol entries + string table entires, in addition to bloom filter words.
It might slightly increase dynamic loading time but I'm probably lying now to increase bullet points for why we shouldn't export all the symbols.
I suspect this may have come up already but I can't seem to find it, but I recall perhaps it had something to do with a requirement of std to make all their symbols public and this is somehow reflected in the binary? or perhaps it was something to do with more 3rd party linker nonsense.
Anyway, if there's a technical possibility to stop it, we should try and be good binary citizens.