Limit exported symbols

Symbols from static libraries included in dynamic libraries are exported from
the dynamic library by default, and the usual "-Wl,--exclude-libs,ALL" doesn't
work for 64-bit libraries, so use a version script instead to ensure we only
export the necessary symbols.
This prevents applications from accessing the libraries outside of the
provided API, and reduces total size of extractor libraries by over 20%.

Test: build, run

Change-Id: I0aa1bd5fdc638960e66f59c867731a0aad255896
gugelfrei
Marco Nelissen 7 years ago
parent 021c8bc0db
commit 03bb4d504d

@ -23,6 +23,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -23,6 +23,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -28,6 +28,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -27,6 +27,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -31,6 +31,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -31,6 +31,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -33,6 +33,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -41,6 +41,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -28,6 +28,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };

@ -27,6 +27,7 @@ cc_library_shared {
"-Wall",
"-fvisibility=hidden",
],
version_script: "exports.lds",
sanitize: {
cfi: true,

@ -0,0 +1 @@
{ global: GETEXTRACTORDEF; local: *; };
Loading…
Cancel
Save