| 1 | /* Some compiler optimizations may transform loops into memset/memmove |
| 2 | calls and without proper declaration it may generate PLT calls. */ |
| 3 | #if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \ |
| 4 | && !defined LIBC_NONSHARED |
| 5 | asm ("memmove = __GI_memmove"); |
| 6 | asm ("memset = __GI_memset"); |
| 7 | asm ("memcpy = __GI_memcpy"); |
| 8 | |
| 9 | /* clang might generate the internal fortfify calls when it is enabled, |
| 10 | through the buitintin. */ |
| 11 | asm ("__vfprintf_chk = __GI___vfprintf_chk"); |
| 12 | asm ("__vsprintf_chk = __GI___vsprintf_chk"); |
| 13 | asm ("__vsyslog_chk = __GI___vsyslog_chk"); |
| 14 | asm ("__memcpy_chk = __GI___memcpy_chk"); |
| 15 | asm ("__memmove_chk = __GI___memmove_chk"); |
| 16 | asm ("__memset_chk = __GI___memset_chk"); |
| 17 | asm ("__mempcpy_chk = __GI___mempcpy_chk"); |
| 18 | asm ("__stpcpy_chk = __GI___stpcpy_chk"); |
| 19 | asm ("__strcpy_chk = __GI___strcpy_chk"); |
| 20 | asm ("strcpy = __GI_strcpy"); |
| 21 | asm ("strncpy = __GI_strncpy"); |
| 22 | asm ("strcat = __GI_strcat"); |
| 23 | asm ("strlen = __GI_strlen"); |
| 24 | |
| 25 | /* Some targets do not use __stack_chk_fail_local. In libc.so, |
| 26 | redirect __stack_chk_fail to a hidden reference |
| 27 | __stack_chk_fail_local, to avoid the PLT reference. |
| 28 | __stack_chk_fail itself is a global symbol, exported from libc.so, |
| 29 | and cannot be made hidden. */ |
| 30 | |
| 31 | # if IS_IN (libc) && defined SHARED \ |
| 32 | && defined STACK_PROTECTOR_LEVEL && STACK_PROTECTOR_LEVEL > 0 |
| 33 | asm (".hidden __stack_chk_fail_local\n" |
| 34 | "__stack_chk_fail = __stack_chk_fail_local"); |
| 35 | # endif |
| 36 | #endif |