1

Objective: To understand the reason for the difference in binary sizes of same binary built in two identical environments

Background: We have created a new duplicate build environment in a different location. However when the binary size is compared between these two environments, more than 60% of binaries are not having the same size in both environments.

Actions Taken / Required: In order ro understand the reasons for the varying size, We tried using the tools like readelf, objdump, cmp, vbindiff, Beyond Compare etc. Using these tools We are able to get the differences highlighted, but not sure what is the meaning of it and how to take action to resolve the size issue.

For Example:

Binary 1 from environment 1 shows: Entry point address: 0x10cc8

Binary 1 from environment 2 shows: Entry point address: 0x10d10

Not sure what the above difference in these two binary meant.

Similarly

Binary 1 from environment 1 shows: Start of section headers: 215080 (bytes into file)

Binary 1 from environment 2 shows: Start of section headers: 215172 (bytes into file)

Similarly there are various instances of differences between these two binaries.

Can you suggest the ways to understand the differences highlighted in order to take action to understand the reasons for the binary file size differences.

PS: I have gone through the following post and was very helpful to follow some of the steps gcc compiled binaries w/different sizes?

Thanks in advance

Community
  • 1
  • 1
gyanesh
  • 11
  • 2
  • Can you give more details? Such as what are you comparing. Maybe you'll get better answers in this way – ppaulojr Dec 03 '12 at 17:07
  • Thanks. I have updated now. Please let me know if this is fine – gyanesh Dec 03 '12 at 18:45
  • Identical Processors? Architecture? Operating Systems? How Identical are we talking? Are you sure every single Header/library is the same version? – Doon Dec 03 '12 at 18:47
  • The Operating System, Hardware, the compiler versions,etc are identical. Are there any other checks which i need to do, so that it helps in understanding the difference. I can get all of these details. – gyanesh Dec 03 '12 at 18:51
  • do subsequent builds on the same machine generate the same binaries? Or is there dynamic information (such as date/time stamps, TZ's Locale,? etc.. that gets included) – Doon Dec 03 '12 at 19:51
  • Yes, subsequent builds on the same machine generates the same binaries. We have seen that maximum difference is 4 bytes. Not more. However here the difference is higher some time in range of 300 to 400 bytes. – gyanesh Dec 03 '12 at 19:54
  • OS: UNIX, Machine: Sparc v8+ – gyanesh Dec 03 '12 at 19:54
  • The one difference is that the path mentioned under Library runpath: and Library rpath: are different in these two environments. – gyanesh Dec 03 '12 at 20:03

0 Answers0