1 unstable release
0.4.0 | Mar 1, 2025 |
---|
#2 in #diffs
138 downloads per month
Used in wild-linker
340KB
7.5K
SLoC
linker-diff
Linker-diff is a command-line utility that diffs two ELF binaries (shared objects or executables). At least one of the binaries being diffed needs layout information as can optionally be produced by the Wild linker.
Usage
The easiest way to use linker-diff is to first make sure it's installed into the same directory as
the wild linker, then build with the environment variable WILD_REFERENCE_LINKER
set to the name of
another linker. e.g.
WILD_REFERENCE_LINKER=ld cargo test
When this variable is set, each time the wild linker is invoked, it'll call the specified linker then run linker-diff on the result.
lib.rs
:
This crate finds differences between two ELF files. It's intended use is where the files were produced by different linkers, or different versions of the same linker. So the input files should be the same except for where the linkers make different decisions such as layout.
Because the intended use is verifying the correct functioning of linkers, the focus is on avoiding false positives rather than avoiding false negatives. i.e. we'd much rather fail to report a difference than report a difference that doesn't matter. Ideally a reported difference should indicate a bug or missing feature of the linker.
Right now, performance of this library is not a priority, so there's quite a bit of heap allocation going on that with a little work could be avoided. If we end up using this library as part of a fuzzer this may need to be optimised.
Dependencies
~23–34MB
~621K SLoC