NASA-SW-VnV / ikos

Static analyzer for C/C++ based on the theory of Abstract Interpretation.
Other
2.03k stars 150 forks source link

[analyzer] Fix processing of llvm-objdump-14's output in ikos-scan (#203) #240

Closed ivanperez-keera closed 10 months ago

ivanperez-keera commented 10 months ago

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".