__strcpy_sse2_unaligned with -fno-builtin

拈花ヽ惹草 提交于 2019-12-02 07:42:24

问题


I was debugging my program, then the last line happened, how can I fix it? I used the -fno-builtin to have a look at the strcpy() but it shows that the __strcpy_sse2_unaligned is getting called.

root@19:~/booksrc# gcc -fno-builtin -g char_array2.c
root@19:~/booksrc# gdb -q ./a.out
Reading symbols from ./a.out...done.
(gdb) list
1   #include <stdio.h>
2   #include <string.h>
3   
4   int main() {
5      char str_a[20];
6   
7      strcpy(str_a, "Hello World!\n");
8      printf(str_a);
9   }
(gdb) break 6
Breakpoint 1 at 0x708: file char_array2.c, line 6.
(gdb) break strcpy
Breakpoint 2 at 0x5a0
(gdb) break 8
Breakpoint 3 at 0x71b: file char_array2.c, line 8.
(gdb) run
Starting program: /root/booksrc/a.out 

Breakpoint 1, main () at char_array2.c:7
7      strcpy(str_a, "Hello World!\n");
(gdb) cont
Continuing.

Breakpoint 2, __strcpy_sse2_unaligned ()
    at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:47
47  ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.

回答1:


__strcpy_sse2_unaligned is the implementation of strcpy which is used on your machine. glibc automatically chooses an optimized implementation based on CPU characteristics, using an IFUNC resolver.

This does not have to do anything with GCC and GCC built-ins. GCC emits a call to strcpy. It is just that glibc happens to call the function which it __strcpy_sse2_unaligned.



来源:https://stackoverflow.com/questions/47119328/strcpy-sse2-unaligned-with-fno-builtin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!