Author Topic: How to remove debugging information from the final exe file (gcc 9.2.0-5)  (Read 2745 times)

Igor

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +12/-0
    • View Profile
I came across the fact that in the executable file a large amount of space is occupied by textual information of about this type:
Code: [Select]
C:/usr/bin/../lib/gcc/i686-pc-os2-emx/9/../../../crt0.o
D:\Temp/ccLyDNo2.s
D:/Users/dmik/rpmbuild/BUILD/libc-0.1.10/src/emx/src/lib/startup/386/crt0.s
__crt0_fpucw
ForkModule
do_exit
atlas.o
__Z12FEnsureAtlasv.part.0
__ZL6rgcnca
__ZL6rgcnew
__ZZ6SzCityiE6szCity
__ZL6rgcnus
calc.o
__Z11FEnsureGridv.part.0
__Z15SwissEnsurePathv.part.0
__ZZ12FSwissPlanetidiPdS_S_S_S_S_E9nSwissEph
__ZL8rgObjJPL
_CSWTCH.427
__ZZ16SwissComputeStardP10_ExtraStarE5istar
__ZZ16SwissComputeStardP10_ExtraStarE7lonPrev
__ZZ16SwissComputeStardP10_ExtraStarE7latPrev
__ZZ20SwissComputeAsteroiddP10_ExtraStariE4iast
charts0.o
__ZZ6PrintSPKcE7ch2Prev
__ZZ6PrintSPKcE7ch3Prev
__ZZ6PrintSPKcE7ch4Prev
charts1.o
__Z13ChartEsotericv.part.0
__Z9ChartGridv.part.0
charts2.o
charts3.o
data.o
express.o

What keys does the compiler need to set so that this information is not added to?
Now I use such a command file:
Code: [Select]
gcc.exe -O2 -g0 -fcombine-stack-adjustments -fexpensive-optimizations -ffunction-cse -fgcse-las -finline-small-functions -march=i686 -Wno-write-strings -DNO_SWE_GLP -c *.cpp
gcc -Zexe -g0 -o myexe *.o

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Remove the -g0 from the CFLAGS and LDFLAGS. You should also change the -Zexe to -Zomf.

Igor

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +12/-0
    • View Profile
Remove the -g0 from the CFLAGS and LDFLAGS. You should also change the -Zexe to -Zomf.
Thanks!