[llvm-bugs] [Bug 31625] New: -fno-zero-initialized-in-bss -fno-common and tentative definitions

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 12 20:25:41 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31625

            Bug ID: 31625
           Summary: -fno-zero-initialized-in-bss -fno-common and tentative
                    definitions
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang's support for -fno-zero-initialized-in-bss does not match GCC's.
In particular, when using -fno-common, tentative definitions are still placed
by GCC into BSS.

Online compiler:
http://melpon.org/wandbox/permlink/76ugV7cPaxxqjIMl

### Source (<stdin>):
int x;


### Compiler invocation:
clang -c -o a.o -x c -fno-common -fno-zero-initialized-in-bss -


### Additional commands:
objdump -wt a.o | grep -P '\b''x\b'


### Expected output:
0000000000000000 g     O .bss    0000000000000004 x


### Actual output:
0000000000000000 g     O .data    0000000000000004 x


### clang -v:
clang version 4.0.0 (trunk 290110)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170113/825cc2bd/attachment.html>


More information about the llvm-bugs mailing list