This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/18403] statically linked app uses


https://sourceware.org/bugzilla/show_bug.cgi?id=18403

--- Comment #1 from Dave Hansen <dave at sr71 dot net> ---
I have a small application:

int main() {
    int i;
    char msg[] = "hello dave\n";

    write(1, msg, sizeof(msg));
    sleep(9999);
    return 0;

}

Which I compile like this, and run under gdb:

gcc -static -g -o hellodave hellodave.c

I've indicated in comments where the FPU gets used and provided disassembly and
a backtrace.

(gdb) break strlen
Breakpoint 1 at 0x41b2c0
(gdb) start
Temporary breakpoint 2 at 0x400e06: file hellodave.c, line 19.
Starting program: /root/hellodave 

Breakpoint 1, 0x000000000041b2c0 in strlen ()
# at this point the FPU is not in use
(gdb) stepi
0x000000000041b2c5 in strlen ()
# The FPU has now been used
(gdb) disassemble strlen
Dump of assembler code for function strlen:
   0x000000000041b2c0 <+0>:     pxor   %xmm8,%xmm8
=> 0x000000000041b2c5 <+5>:     pxor   %xmm9,%xmm9
   0x000000000041b2ca <+10>:    pxor   %xmm10,%xmm10
...
(gdb) bt
#0  0x000000000041b2c5 in strlen ()
#1  0x00000000004074a6 in getenv ()
#2  0x0000000000439f9e in _dl_non_dynamic_init ()
#3  0x000000000043ad18 in __libc_init_first ()
#4  0x000000000040102c in __libc_start_main ()
#5  0x0000000000400d09 in _start ()
(gdb)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]