On Fri, Jan 10, 2014 at 6:20 PM, Ted Roby <ted.r...@gmail.com> wrote:
> Consider the following structs. The first struct uses 1 bit wide unsigned 
> integers
> for two flags set by the user during runtime. The second struct performs the 
> same
> function, but used a regular signed integer instead of an unsigned integer 
> with
> a defined bit width.
...
> when I run size on the compiled binary and its stripped version there
> seems to be a difference of 32 bits in the text portion and overall size.
...
> Why is the non-stripped, one bit wide integer binary larger than
> the non-stripped, regular integer binary?

Because the stuff that strip removes is bigger for one than the other,
of course.  Perhaps you should research exactly _what_ strip is
removing.  The strip(1) manpage has a reference to the binutils 'info'
pages, which describe programs like "readelf" and "objdump" which will
tell you more about exactly what are in a binary file, stripped or
unstripped.  If you compare those, you should be able to see where the
size differences lie...though to understand *why* they are different
in size you may need to research the details of binary formats like
ELF and DWARF and how they represent symbols and types.


Philip Guenther

Reply via email to