diff options
author | Alex Salcianu <salcianu@google.com> | 2017-03-24 16:54:05 -0400 |
---|---|---|
committer | Alex Salcianu <salcianu@google.com> | 2017-03-24 16:54:05 -0400 |
commit | 5fc7e54900619518beaa3ab5638197f8691b27ce (patch) | |
tree | e08231c63621676d5ee2e39a872c0d0dfe0e515d /jni.lds | |
parent | 9a2fe7af3672216ebc5febb7127cd18cfaeb5cae (diff) | |
download | libtextclassifier-5fc7e54900619518beaa3ab5638197f8691b27ce.tar.gz |
[smart-select:] Use a linker version script, to remove even more deadcode.
The size of our 32-bit lib went down 264K -> 180K (1K = 1024 bytes).
$ mmma -j32 external/libtextclassifier
$ ls -sh $OUT/system/lib/libtextclassifier.so
180K <SKIPPED/LONG/PATH/TO>/system/lib/libtextclassifier.so
$ # :)
Treemap info:
https://cnsviewer.corp.google.com/cns/ig-d/home/salcianu/libtextclassifier/treemap/android_03_24.3/index.html
The gap between the treemap measured code size and the .so file size is now down
to 40K, i.e., 22% (down from 43% this morning).
Previously, we were using only -fvisibility=hidden for our code. That impacted
only the symbols exported from our code, not the symbols from the static libs we
depend on. The linker script handles everything.
Test: manual test that everything builds + inspection of treemap info.
All required code seems to be linked in.
Change-Id: I00bfea854a80ef365b229632d2af259c938159c2
Diffstat (limited to 'jni.lds')
-rw-r--r-- | jni.lds | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +{ + # Export symbols that correspond to our JNIEXPORTed functions. + global: + Java_android_view_textclassifier_*; + + # Hide everything else. + local: + *; +}; |