Export public __aeabi* symbols as LIBC_PRIVATE

But keep LIBC as default version for them

Bug: http://b/26391427
Bug: http://b/26410625
Change-Id: I819e354bbba482d1f983d9be15c23fcce10e5dd9
This commit is contained in:
Dimitry Ivanov 2016-01-05 16:38:43 -08:00
parent e647db7485
commit d90d067312
4 changed files with 75 additions and 16 deletions

View File

@ -51,34 +51,34 @@ extern int __cxa_atexit(void (*)(void*), void*, void*);
*/
int __attribute__((weak))
__aeabi_atexit(void *object, void (*destructor) (void *), void *dso_handle) {
__aeabi_atexit_impl(void *object, void (*destructor) (void *), void *dso_handle) {
return __cxa_atexit(destructor, object, dso_handle);
}
void __attribute__((weak))
__aeabi_memcpy8(void *dest, const void *src, size_t n) {
__aeabi_memcpy8_impl(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy4(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memcpy4_impl(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memcpy_impl(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove8(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memmove8_impl(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove4(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memmove4_impl(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memmove_impl(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
@ -87,27 +87,47 @@ void __attribute__((weak)) __aeabi_memmove(void *dest, const void *src, size_t n
* This allows __aeabi_memclr to tail-call __aeabi_memset
*/
void __attribute__((weak)) __aeabi_memset8(void *dest, size_t n, int c) {
void __attribute__((weak)) __aeabi_memset8_impl(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset4(void *dest, size_t n, int c) {
void __attribute__((weak)) __aeabi_memset4_impl(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset(void *dest, size_t n, int c) {
void __attribute__((weak)) __aeabi_memset_impl(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memclr8(void *dest, size_t n) {
__aeabi_memset8(dest, n, 0);
void __attribute__((weak)) __aeabi_memclr8_impl(void *dest, size_t n) {
__aeabi_memset8_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr4(void *dest, size_t n) {
__aeabi_memset4(dest, n, 0);
void __attribute__((weak)) __aeabi_memclr4_impl(void *dest, size_t n) {
__aeabi_memset4_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr(void *dest, size_t n) {
__aeabi_memset(dest, n, 0);
void __attribute__((weak)) __aeabi_memclr_impl(void *dest, size_t n) {
__aeabi_memset_impl(dest, n, 0);
}
#define __AEABI_SYMVERS(fn_name) \
__asm__(".symver " #fn_name "_impl, " #fn_name "@@LIBC"); \
__asm__(".symver " #fn_name "_impl, " #fn_name "@LIBC_PRIVATE")
__AEABI_SYMVERS(__aeabi_atexit);
__AEABI_SYMVERS(__aeabi_memcpy8);
__AEABI_SYMVERS(__aeabi_memcpy4);
__AEABI_SYMVERS(__aeabi_memcpy);
__AEABI_SYMVERS(__aeabi_memmove8);
__AEABI_SYMVERS(__aeabi_memmove4);
__AEABI_SYMVERS(__aeabi_memmove);
__AEABI_SYMVERS(__aeabi_memset8);
__AEABI_SYMVERS(__aeabi_memset4);
__AEABI_SYMVERS(__aeabi_memset);
__AEABI_SYMVERS(__aeabi_memclr8);
__AEABI_SYMVERS(__aeabi_memclr4);
__AEABI_SYMVERS(__aeabi_memclr);
#undef __AEABI_SYMVERS

View File

@ -1269,6 +1269,7 @@ LIBC_PRIVATE {
__accept4; # arm x86 mips
__adddf3; # arm
__addsf3; # arm
__aeabi_atexit; # arm
__aeabi_cdcmpeq; # arm
__aeabi_cdcmple; # arm
__aeabi_cdrcmple; # arm
@ -1307,6 +1308,18 @@ LIBC_PRIVATE {
__aeabi_llsl; # arm
__aeabi_llsr; # arm
__aeabi_lmul; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
__aeabi_ui2d; # arm
__aeabi_ui2f; # arm
__aeabi_uidiv; # arm

View File

@ -1270,6 +1270,7 @@ LIBC_PRIVATE {
__accept4; # arm x86 mips
__adddf3; # arm
__addsf3; # arm
__aeabi_atexit; # arm
__aeabi_cdcmpeq; # arm
__aeabi_cdcmple; # arm
__aeabi_cdrcmple; # arm
@ -1308,6 +1309,18 @@ LIBC_PRIVATE {
__aeabi_llsl; # arm
__aeabi_llsr; # arm
__aeabi_lmul; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
__aeabi_ui2d; # arm
__aeabi_ui2f; # arm
__aeabi_uidiv; # arm

View File

@ -1296,6 +1296,7 @@ LIBC_PRIVATE {
__accept4; # arm x86 mips
__adddf3; # arm
__addsf3; # arm
__aeabi_atexit; # arm
__aeabi_cdcmpeq; # arm
__aeabi_cdcmple; # arm
__aeabi_cdrcmple; # arm
@ -1334,6 +1335,18 @@ LIBC_PRIVATE {
__aeabi_llsl; # arm
__aeabi_llsr; # arm
__aeabi_lmul; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
__aeabi_ui2d; # arm
__aeabi_ui2f; # arm
__aeabi_uidiv; # arm