[llvm-bugs] [Bug 51335] New: option -fno-zero-initialized-in-bss will put uninitialized variables to data section

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 3 21:04:42 PDT 2021


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

            Bug ID: 51335
           Summary: option -fno-zero-initialized-in-bss will put
                    uninitialized variables to data section
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: 2077213809 at qq.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

The code is as follows: g_bss is placed in the data section. When I add the
-fno-zero-initialized-in-bss option, it is expected to be in the bss section.
When I remove the pragma, it's normal. Both g_bss and g_test are placed in the
bss section.

#pragma clang section bss="MyBss" data="MyData"
int g_bss;
int g_test = 0;
int main()
{

}

-- 
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/20210804/62523e05/attachment.html>


More information about the llvm-bugs mailing list