Skip to content

Exit status does not report "same" or "different", making it impossible to write a script around elf_diff #107

Description

@derekatkins

Describe the bug
I am trying to use elf_diff in a script to compare whether there was a change in code between two compiles of (ostensibly) the same code. Because this is in a script, I was looking to use the exit code from elf_diff (similar to how you can use the exit code from diff, or cmp, to know if the files being compared are the same or have differences). Unfortunately elf_diff appears to always exit with the same exit code regardless of whether there are actual differences.

To Reproduce
Steps to reproduce the behavior:

  1. run comparing a file to itself: elf_diff /bin/bash /bin/bash
  2. Check the output status (in this case, 0)
  3. re-run with files that are definitely different: elf_diff /bin/bash /bin/true
  4. Check the output status and see that it is again 0

Expected behavior
I expected the exit status to be a summary of whether or not the compared files are the same. For example, if you use 'cmp' instead then when comparing /bin/bash to itself you get an exit status of 0, and when comparing bash to true you get an exit status of one. This makes it scriptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions