5 ms·
I'm aware of that, I guess my point was that Rust probably doesn't use a lot of glibc (like most C programs would) so the utility of LD_PRELOAD is quite minimal
by cyphar 8y ago
I'm aware of that, I guess my point was that Rust probably doesn't use a lot of glibc (like most C programs would) so the utility of LD_PRELOAD is quite minimal.
I don't know enough about .rlib to know whether you could overwrite Rust library functions, but that's a different topic.
- steveklabnik 8y agoRust uses glibc to call into the kernel like anything else. The standard library is built on top of it.
- cyphar 8y agoRight, but does that mean it's only used as a way of getting syscall numbers (without embedding it like Go does) or is it the case that you could actually LD_PRELOAD random things like nftw(3) and it would actually affect Rust programs? I'll be honest, I haven't tried it, but it was my impression that Rust only used glibc for syscall wrappers?
- steveklabnik 8y agoWe don’t provide nftw like functionality in std, and so you can’t replace it as it would have never even been called. But for example, malloc and free are used, not sbrk directly: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/alloc.rs https://github.com/rust-lang/rust/blob/master/src/libstd/sys...