How it works...

Most of this recipe should be fairly familiar in terms of reading the output of the readelf tool, the ELF man page output, and the elf.h output. In this recipe, we're investigating one program that's been compiled in two different ways and examining the ELF information of the resultant binaries. Don't worry if you don't recognize all of the segments or sections of these binaries just yet; the point of this exercise is reveal the differences that can occur in binaries based on the options that are passed during compilation. We also want to see the differences between a binary originally written in assembly versus a binary originally written in a higher-level language such as C.

The ELF man page and the output of the elf.h

Get Binary Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.