Rust library for checking .rlib files

I am looking for a way to download and verify .rlib binaries created by rustc. I hunted around the standard library without much luck. My guess is that .rlib contains all the type information needed for the static type of the scan programs that are extern crate. rustc :: metadata is where my hunt ended. I cannot understand if the structures currently available in the compiler are available as entry points for users or if they are exclusively intermediate abstractions depending on the chain of previously initialized data.

Alternatively, if there is a way to dump .rlib to stdout in parsed form, then this is also fantastic. I tried / usr / bin / nm, but it seems to exclude function type signatures. Maybe I missed something.

In any case, I am working on an editor utility for emacs, which I hope will at some point provide context-sensitive information such as available methods, module elements and their types, etc. I would really appreciate any tips anyone has.

+6
source share
1 answer

The .rlib file is an archive file. You can use readelf to read its contents.

Try readelf -s <your_lib>.rlib . The type name can be mixed / decorated by the compiler, so it may not be the same as in the .rs file.

+1
source

Source: https://habr.com/ru/post/971846/


All Articles