<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 24, 2017 at 2:53 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 4/23/2017 10:10 AM, Andrew Kelley via llvm-dev wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Here is a module:<br>
<br>
@vals = internal unnamed_addr global [20000000 x i32] undef, align 4<br>
<br></span><span class="">
LLVM puts the global in the .data section, and results in a 77MB .o file of mostly zeroes. Why does this variable not go in the .bss section?<br>
<br>
</span></blockquote>
<br>
I think it's just an oversight; it doesn't matter for clang because it never emits globals like that.  See TargetLoweringObjectFile::getK<wbr>indForGlobal for the relevant logic.</blockquote><div><br></div><div>I see, thanks. Would a patch be welcome which changed this behavior? Or I suppose I could emit zeroinitializer instead of undef. But it seems like undef is the more correct value.</div></div><br></div></div>