diff options
author | Dan Albert <danalbert@google.com> | 2014-10-07 11:10:36 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-10-07 16:46:47 -0700 |
commit | 658727e111ed6dee7be5239494f0764f7b1b02f8 (patch) | |
tree | 253051956500d39d0a9e8d282aacebe78dc21def /libc/include/string.h | |
parent | eeb9aa02b7f307a1d9b80731dd69ef9dd2f47e47 (diff) | |
download | bionic-658727e111ed6dee7be5239494f0764f7b1b02f8.zip bionic-658727e111ed6dee7be5239494f0764f7b1b02f8.tar.gz bionic-658727e111ed6dee7be5239494f0764f7b1b02f8.tar.bz2 |
Inline helpers need to be exported unmangled.
__open_2() is used by the fortify implementation of open(2) in
fcntl.h, and as such needs an unmangled C name. For some reason
(inlining?), this doesn't cause problems at the default optimization
level, but does for -O0.
The rest of these didn't cause build failures, but they look suspect
and probably will, we just haven't caught them yet.
Bug: 17784968
Change-Id: I7391a7a8999ee204eaf6abd14a3d5373ea419d5b
Diffstat (limited to 'libc/include/string.h')
-rw-r--r-- | libc/include/string.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libc/include/string.h b/libc/include/string.h index fb24808..611c31a 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -111,6 +111,13 @@ extern char* basename(const char*) __RENAME(__gnu_basename) __nonnull((1)); #define __bionic_using_gnu_basename #endif +extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); +extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); +extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcpy); +extern size_t __strlcpy_chk(char *, const char *, size_t, size_t); +extern size_t __strlcat_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcat); +extern size_t __strlcat_chk(char* __restrict, const char* __restrict, size_t, size_t); + #if defined(__BIONIC_FORTIFY) __BIONIC_FORTIFY_INLINE @@ -133,8 +140,6 @@ char* strcpy(char* __restrict dest, const char* __restrict src) { return __builtin___strcpy_chk(dest, src, __bos(dest)); } -extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); - __BIONIC_FORTIFY_INLINE char* stpncpy(char* __restrict dest, const char* __restrict src, size_t n) { size_t bos_dest = __bos(dest); @@ -156,8 +161,6 @@ char* stpncpy(char* __restrict dest, const char* __restrict src, size_t n) { return __stpncpy_chk2(dest, src, n, bos_dest, bos_src); } -extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); - __BIONIC_FORTIFY_INLINE char* strncpy(char* __restrict dest, const char* __restrict src, size_t n) { size_t bos_dest = __bos(dest); @@ -194,9 +197,6 @@ void* memset(void *s, int c, size_t n) { return __builtin___memset_chk(s, c, n, __bos0(s)); } -extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcpy); -extern size_t __strlcpy_chk(char *, const char *, size_t, size_t); - __BIONIC_FORTIFY_INLINE size_t strlcpy(char* __restrict dest, const char* __restrict src, size_t size) { size_t bos = __bos(dest); @@ -217,9 +217,6 @@ size_t strlcpy(char* __restrict dest, const char* __restrict src, size_t size) { return __strlcpy_chk(dest, src, size, bos); } -extern size_t __strlcat_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcat); -extern size_t __strlcat_chk(char* __restrict, const char* __restrict, size_t, size_t); - __BIONIC_FORTIFY_INLINE size_t strlcat(char* __restrict dest, const char* __restrict src, size_t size) { |