[LLVMdev] Newbie question

Renato Golin rengolin at systemcall.org
Thu Jul 2 05:05:32 PDT 2009

Hi all,


I'm a long time gnu toolchain user for unix and just got interested in
llvm this week, so my questions could be *very* naive. I've read lots
of the good documentation on the website and wiki, tutorials,
reference manual etc. and have been following this list for a few
days. But there's still a lot to read, so excuse me if the answers are
already on some FAQ, I'd be glad to be quickly pointed out to more

The problem:

I got a few very simple programs to compile with both gnu and llvm
toolchain and inspect the elf information and optimizations done
(attached a zip with the code and the makefile).

For the C code I got smaller and faster programs, excellent! But for
the C++ it was a bit of a shock to see a 100x increase in size. The
execution time is 2-fold, but the programs are to simple and too fast
to make any difference meaningful.

When inspecting the final binaries, I found lots (~2000) of
".llvm.linkonce.t.*" PROGBITS sections. As far as I could see they're
all stdlibc++ calls (types, IO, exceptions etc.), which g++ didn't
generate, nor did llvm-gcc or gcc for the libc.

Shouldn't the shared libraries be only linked instead of incorporated
into the program? Am I missing something?

To compile, I'm only calling:
$ llvm-g++ source.cpp -o program


Reclaim your digital rights, eliminate DRM, learn more at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-test.zip
Type: application/zip
Size: 2521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090702/c6589108/attachment.zip>

More information about the llvm-dev mailing list