ART: Set default visibility to protected
Set default visibility of symbols to protected. This allows the
linker to optimize internal calls and helps avoid plt calls.
Make almost all assembly stubs hidden, as -fvisibility does not
seem to apply to them. Change the assembly tests accordingly. Also
allows to clean up previous hacks to avoid plt calls.
Bug: 16974467
(cherry picked from commit 235e77bd9f19e4faefda109be40f8744f3a66f40)
Change-Id: I9030dcf6116251f434f94a2b08e56e12085af652
diff --git a/runtime/arch/memcmp16.h b/runtime/arch/memcmp16.h
index 14dc1e3..4b9fb8e 100644
--- a/runtime/arch/memcmp16.h
+++ b/runtime/arch/memcmp16.h
@@ -50,4 +50,17 @@
extern "C" int32_t memcmp16_generic_static(const uint16_t* s0, const uint16_t* s1, size_t count);
#endif
+namespace art {
+
+namespace testing {
+
+// A version that is exposed and relatively "close to the metal," so that memcmp16_test can do
+// some reasonable testing. Without this, as __memcmp16 is hidden, the test cannot access the
+// implementation.
+int32_t MemCmp16Testing(const uint16_t* s0, const uint16_t* s1, size_t count);
+
+}
+
+} // namespace art
+
#endif // ART_RUNTIME_ARCH_MEMCMP16_H_