Use a version script for libaconfig_storage_read_api_cc

Restrict the set of exported symbols to those in the aconfig_storage
namespace by way of a version script. This shrinks the shared lib size
by ~75%, from ~800KB to <200KB.

Bug: 336657207
Test: m
Change-Id: I56044fe667a713cf1d94f96c992f379a5725850f
This commit is contained in:
Jared Duke
2024-04-25 19:04:01 +00:00
parent c6e4a86b03
commit 8782e1e858
2 changed files with 12 additions and 3 deletions

View File

@@ -102,8 +102,6 @@ cc_library {
"//apex_available:anyapex",
],
min_sdk_version: "29",
version_script: "libaconfig_storage_read_api_cc.map",
double_loadable: true,
cflags: [
"-fvisibility=hidden",
],
}

View File

@@ -0,0 +1,11 @@
LIBACONFIG_STORAGE_READ_API_CC {
# Export everything in the aconfig_storage namespace. This includes both the
# public API and library internals.
global:
extern "C++" {
aconfig_storage::*;
};
# Hide everything else.
local:
*;
};