[analyzer] Fix processing of llvm-objdump-14's output in ikos-scan (#203) #240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The output format of llvm-objdump has changed since version 9 (the one supported by IKOS 3.0) and version 14 (the one supported by IKOS 3.1). Specifically, the output produces one fewer empty line prior to the actual content of the section being extracted from a binary file.
This difference is breaking ikos-scan, which parses the output of llvm-objdump looking for the section.
The way that such output is produced by llvm-objdump is hard-coded. There are no settings that would allow us to obtain only the hex the section we are looking for without the preceding preamble, address or the posterior ASCII.
This commit updates the code that processes the output to skip only three lines, conforming to the output produced by llvm-objdump-14. The code is also documented to help understand the nature of that magic number, as well as other aspects of that "parser".