SO file package size optimization

1. Compilation parameters --ffunction-sections, -fdata-sections, link parameters -Wl, --gc-sections,

      --ffunction-sections and -fdata-sections will compile the symbols into separate sections, --gc-sections will remove unused symbols when linking, thus reducing the package size

 

2. -Ox, the relationship between the package size of each level: -O3> -O2> -Os, my own experiment: -O3 package is 13.5M, changed to -O2 is 12M, and changed to -Os is 9.7M.

Published 60 original articles · Like 44 · Visits 340,000+

Guess you like

Origin blog.csdn.net/beyond702/article/details/90475024