Symbols are unnecessarily exported
@dkg noticed that rpm-sequoia, which creates a C library, unnecessarily exports some symbols. Specifically:
rust_eh_personality
sha1_compression_states
SHA1DCFinal
SHA1DCInit
SHA1DCSetCallback
SHA1DCSetDetectReducedRoundCollision
SHA1DCSetSafeHash
SHA1DCSetUseDetectColl
SHA1DCSetUseUBC
SHA1DCUpdate
sha1_dvs
ubc_check
With the exception of rust_eh_personality
, all of the symbols come from this crate.
Looking at the code, the functions are declared as follows:
#[no_mangle]
pub unsafe extern "C" fn sha1_compression_states(
AFAICT, the crate is not creating a C library so exporting them in this way is not necessary, I think.
After a bit of investigation, we only have to remove the #[no_mangle]
attribute to prevent the symbols from being exported. That is, we don't have to remove the extern "C"
attribute, but it unclear to me why the functions are using a C ABI. Perhaps it makes sense to remove that as well.