iOS TensorFlowLiteC App Size impact
Related: https://github.com/tensorflow/tensorflow/issues/46674 Hi @yishuangP, can you please take a look? Thanks. I am not an expert on these topics but I am trying to do more research on them.
I found out that after hiding the symbols, some of them are now `no dead strip`:

Binary without symbol hiding:
```
nm -m ios-arm64/TensorFlowLiteC.framework/TensorFlowLiteC | grep 'no dead strip' | wc -l
0
```
Binary with symbol hiding:
```
nm -m ios-arm64/TensorFlowLiteC.framework/TensorFlowLiteC | grep 'no dead strip' | wc -l
249
```
Maybe that could be the reason why the app binary size increases, the linker can't dead-strip those symbols. @omarzl, feel free to try out your hypothesis and let us know the results. Feel free to submit a PR for us to review if you found a solution. Thanks.
### Issue type

Performance

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

2.15.0

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

6.1.0

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I open this issue to share my findings regarding app size impact of `TensorFlowLiteC` binary in iOS

Currently we are migrating from a really old version to `v2.15.0`: 
https://github.com/tensorflow/tensorflow/blob/v2.15.0/tensorflow/lite/ios/TensorFlowLiteC.podspec

And we noticed a notable size increment:
Download size: `+1.08MB`
Install size: `+2.51MB`

We have a large codebase and the app size is a big concern for us, so I tried to find ways to reduce the impact.
I noticed that there is a macro [`tflite_ios_xcframework`](https://github.com/tensorflow/tensorflow/blob/6887368d6d46223f460358323c4b76d61d1558a8/tensorflow/lite/ios/ios.bzl#L93) which creates the `xcframework` and then modfies the object files to hide public symbols.
So I created a new target using the rule `apple_static_xcframework` directly.
_See https://github.com/omarzl/tensorflow/commit/945d7ec241e759586ca30c32221f5b14504169f0 (I can send the pull request if it helps)_
I named this target `TensorFlowLiteC_static_xcframework`, then I compiled it:
```
bazel build --config=ios_fat -c opt --cxxopt=--std=c++17 \
//tensorflow/lite/ios:TensorFlowLiteC_static_xcframework --subcommands
```

By using the xcframework without hidden symbols I noticed that the size increment was notable less `-50%`:
Download size: `+0.50MB`
Install size: `+1.24MB`

Then I changed the clang optimization to `-Os` instead of `-O3` which is the default one used by Bazel in `opt` config:
```
bazel build --config=ios_fat -c opt --cxxopt=--std=c++17 \
//tensorflow/lite/ios:TensorFlowLiteC_static_xcframework --copt=-Os --subcommands
```

There was a minor improvement using it:
Download size: `+0.49MB`
Install size: `+1.23MB`

Finally I tried using the original `tflite_ios_xcframework` target `TensorFlowLiteC_xcframework` but with `-Os` optimization, I was expecting a minor reduction but I was wrong, instead it incremented:
Download size: `+1.30MB`
Install size: `+3.03MB`

Here is a summary of my tests:
| Size |  Target `TensorFlowLiteC_xcframework` |  Target `TensorFlowLiteC_static_xcframework` |  Target `TensorFlowLiteC_xcframework` & `-Os` opt |  Target `TensorFlowLiteC_static_xcframework` & `-Os` opt |
|---|---|---|---|---|
| Download | `+1.08MB` | `+0.50MB` | `+0.49MB`  | `+1.30MB`  |
| Install  | `+2.51MB` | `+1.24MB`  | `+1.23MB`  | `+3.03MB`  |

I understand the reasons behind hiding symbols since they can cause a symbol collision ending in unexpected behaviors or crashes in the app but these tests found out that it can cause an increment in app size.

For our case, we don't have any symbol collision with Tensorflow so we can use an un-hided version of the xcframework which benefit us in less app size impact.
_As a side note: The linker `ld` warns you if there is a symbol collision, we opt to make warnings to errors to catch any issue of this kind by adding the flag `-Wl,-fatal_warnings`_

Finally looking at the code in `hide_xcframework_symbols_with_allowlist.sh`
https://github.com/tensorflow/tensorflow/blob/6887368d6d46223f460358323c4b76d61d1558a8/tensorflow/lite/ios/hide_xcframework_symbols_with_allowlist.sh#L120
I understand that by using `xcrun ld -r` you are changing public symbols to private ones to prevent this symbol collision but I don't see you are generating a dynamic executable, I see that the output is still a Mach-O object (`MH_OBJECT`) so I think that this documentation https://www.tensorflow.org/lite/guide/build_ios is wrong since there isn't a dynamic framework, it is still a static framework but with hidden symbols.

In summary, I don't think there is much that can be done without hiding the symbols, I open this issue in case anyone finds a better solution to reduce the size impact and to document what I have found.

### Standalone code to reproduce the issue

```shell
The compilation commands were written above.
```


### Relevant log output

_No response_