[LLVMdev] MCStreamer interface

Eli Friedman eli.friedman at gmail.com
Wed May 5 14:11:53 PDT 2010


On Wed, May 5, 2010 at 1:22 PM, Nathan Jeffords <blunted2night at gmail.com> wrote:
> I had a problem with MCStreamer::EmitCommonSymbol
> & MCStreamer::EmitLocalCommonSymbol. When I implemented them I assumed this
> meant to put those symbols into the .bss segment. This required me to get a
> hold of the TLOF from the streamer. I now realize this is wrong after
> re-reading the description of the '.comm' directive a few times.  I am not
> sure why an uninitialized global variable was being emitted using this, that
> seems wrong since global variables in different compilation units with the
> same name would get merged together at link time. (this is using clang on a
> C source file)

Global definitions like "int x;" are treated as common to allow
linking buggy programs that forget to use "extern" on declarations.

-Eli




More information about the llvm-dev mailing list