简体   繁体   中英

strcpy-sse2-unaligned.S not found

I am compiling the simple code below, and run it in gdb. I set a break point at the strcpy line, as soon as I run it for the input for instance abc, and then press s, I get the following error:

Breakpoint 1, main (argc=2, argv=0x7fffffffdd98) at ExploitMe.c:9
9           strcpy(buffer, argv[1]);
(gdb) s
__strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:48
48  ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.

I am using ubuntu 12.04 AMD64 and gcc 2.15. Any idea?


main(int argc, char *argv[]) {

    char buffer[80];

    strcpy(buffer, argv[1]);

    return 0;
}

It is completely harmless to ignore these "errors" when debugging.

The error is simply because GDB is looking for the source of the strcpy function. Any function in libc that you don't have the source for will you give a similar error, eg:

int *p = malloc(sizeof *p);

Then...

(gdb) s
5       int *p = malloc(sizeof *p);
(gdb) s
__GI___libc_malloc (bytes=4) at malloc.c:2910
2910    malloc.c: No such file or directory.

You can always download GNU libc's source and link it with GDB:

git clone https://github.com/jeremie-koenig/glibc /opt/src/glibc

Then...

(gdb) dir /opt/src/glibc/malloc
(gdb) s
5       int *p = malloc(sizeof *p);
(gdb) s
__GI___libc_malloc (bytes=4) at malloc.c:2910
2910              }
(gdb) s
2915          } else if (!in_smallbin_range(size))

... which will let you step through malloc 's source code. It's not particularly useful, but it can come in handy sometimes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM