Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect mempcpy and stpcpy only in libc.a
The mempcpy and stpcpy redirections to __mempcpy and __stpcpy were added by commit 939da41 Author: Joseph Myers <joseph@codesourcery.com> Date: Wed Nov 12 22:36:34 2014 +0000 Fix stpcpy / mempcpy namespace (bug 17573). to fix the namespace bug since __mempcpy and __stpcpy were defined as macros in <bits/string2.h>. These macros call __builtin_mempcpy and __builtin_stpcpy which may end up calling the C functions mempcpy and stpcpy. In libc.so, libc_hidden_builtin_proto ensures that calls to mempcpy and stpcpy are in turn mapped to call __GI_mempcpy and __GI_stpcpy. The redirections were applied outside of libc.so, including libc.a, to map mempcpy and stpcpy to __mempcpy and __stpcpy. Since commit 18b10de Author: Wilco Dijkstra <wdijkstr@arm.com> Date: Mon Jun 12 15:19:38 2017 +0100 2017-06-12 Wilco Dijkstra <wdijkstr@arm.com> There is no longer a need for string2.h, so remove it and all mention of it. Move the redirect for __stpcpy to include/string.h since it is still required until all internal uses have been renamed. This fixes several linknamespace/localplt failures when building with -Os. removed the __mempcpy and __stpcpy macros from the public header file, limit these redirections to libc.a to avoid Clang error: In file included from tst-iconv-sticky-input-error.c:22: In file included from ./gconv_int.h:24: ../include/string.h:182:44: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] 182 | extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy"); | ^ ../string/bits/string_fortified.h:42:8: note: previous definition is here 42 | __NTH (mempcpy (void *__restrict __dest, const void *__restrict __src, | ^ when testing with Clang for fortify build. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
- Loading branch information