I have an iOS application which uses a lot of different static libraries and frameworks (some third party as well). I want to be able to attribute the contribution of the static libs, frameworks & app code to the final app binary size. I came across a previously asked similar question here at: Find size contributed by each external library on iOS
The answer by 'fullofsquirells' is relevant and is well-explained. However, using the link map file approach, if I add up the sizes of all the sections or all the symbols I don't get the final binary size.
More details: My iOS Application's final ipa is ~50 MB. The uncompressed app payload is ~90 MB and contains approx. 50 MB code and 40 MB resources. The 50 MB code binary contains two binary slices corresponding to armv7 and arm64. I can get the separate slices using 'lipo' and each are of approximately similar size, 23 MB(armv7) and 27 MB(arm64).
Using the linkmap approach I am able to get the sizes from the sections as well as from the symbols for each slice (note there is a separate linkmap file for each slice). The problem is if I sum up the sizes of all the sections or all the symbols it does not total upto the app binary size for that slice.
Supposing I have the symbols & sections for arm64 in symbols_arm64.txt & sections_arm64.txt, then:
cat symbols_arm64.txt |grep -e "0x" | awk '{print $2}'| xargs printf "%d\n"|paste -sd+ -|bc
cat sections_arm64.txt |grep -e "0x" | awk '{print $2}'| xargs printf "%d\n"|paste -sd+ -|bc
Both of these return values which are closer to ~15 MB. I was expecting that both of these would be closer to 27 MB.
What is contributing the missing 12 MB?