[LLVMbugs] [Bug 6917] New: clang -fstack-protector doesn't work

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Apr 24 03:03:31 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=6917

           Summary: clang -fstack-protector doesn't work
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


-fstack-protector doesn't work

$ cat >x.c <<EOF
int main()
{
    char buf[4096];
    return 0;
}
EOF

$ clang -fstack-protector x.c
/tmp/cc-5HBV9O.o: In function `main':
x.c:(.text+0xf): undefined reference to `__stack_chk_guard'
x.c:(.text+0x2c): undefined reference to `__stack_chk_guard'
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like it is using the wrong symbols, because gcc creates this:
U __stack_chk_fail
0000000000000000 T main

No reference to __stack_chk_guard.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list