AnsweredAssumed Answered

Binary size not reducing after gstrip

Question asked by Narendra Kumar S S on Jun 29, 2018

Hi,

 

I am using GHS MULTI compiler for building our project. I have used -Osize option to get the optimized build.

After this, I tried to use gstrip utility to strip the binary. Though it is not giving any error, the size remains the same.

When I try to use gstrip on the object file, I get error.

Can someone tell me, how to reduce the size of binary (and also object file) by using gstrip utility?

 

Here below is the o/p from my terminal:

ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$ file Build/ecc.oBuild/ecc.o: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SYSV), not stripped
ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$ /usr/ghs/comp_201516/gstrip Build/ecc.o
gstrip: error: Unable to strip relocatable ELF file 'Build/ecc.o'
ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$ file Build/z4Test.elf Build/z4Test.elf: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, not stripped
ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$ size !$
size Build/z4Test.elf
text data bss dec hex filename
93022 3016 5912 101950 18e3e Build/z4Test.elf
ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$ /usr/ghs/comp_201516/gstrip Build/z4Test.elf
ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$ size Build/z4Test.elf text data bss dec hex filename
93022 3016 5912 101950 18e3e Build/z4Test.elf
ssnkumar@ssnkumar:~/wolfssl-3.15.3/IDE/GHS-NXP$

 

 

 

Regards,

Narendra

Outcomes