On 19/09/2017 06:07, shagun wrote: > We recently noticed that the size of binaries compiled with the newer GCC > (4.8.5) as part of Centos 7 OS is much bigger. Please note that 4.8 was released in 2013 and is no longer supported upstream, as far as I understand. > Further digging revealed that > anything compiled on centos 7 machine has a bigger binary size with at least > 20-30% increase and sometimes double or more. Why is that a problem? Do you see a performance regression? If the increase comes from the text segment, sometimes bigger code runs faster (think unrolling loops). If the increase comes from debug segments, does it matter at all? (You can strip unnecessary information from the binary.) > Eg: I compiled a simple 'hello world' C program on both Centos 6 and Centos > 7. Here are their sizes: > Centos 6: 6465 bytes > Centos 7: 8512 bytes. > > All our C/C++ based application binary sizes have increased which has caused > the size of the ISO to also blow up. It depends on which flags you passed to the toolchain. > Please let us know more details/information on why do we see this increase > and how to mitigate the same. The GCC versions in centos6 is 4.4.7 and in > centos7 is 4.8.5. objdump -xds a.out and examine the difference. Regards.