[Mobile] Use -ffunction-sections and -fdata-sections for Mobile builds (#84704)
Summary: Set `-ffunction-sections` and `-fdata-sections` so that each method has its own text section. This allows the linker to remove unused section when the flag `-Wl,-gc-sections` is provided at link time.
Test Plan: CI and local build using `build_mobile.sh`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84704
Approved by: https://github.com/JacobSzwejbka, https://github.com/cccclai