[LLVMdev] weak linkage

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Dec 6 13:32:58 PST 2006

> Try: int *B = &a;
In LLVM IL this is
%b = global int* %a
%a = weak global int 0

compiling with llc -march=x86-64 produces
        .globl b
        .align  8
b:                              # b
        .size b, 8
        .quad   a

        .comm   a,4,4           # a
Note that no ".weak" directive is printed. gcc prints a ".weak a"
after the ".quad a".

I believe that this is a similar (but more uncommon) problem to one I
am having in ARM when a weak symbol is placed is a global table. I
will send my current hack to the ML in a minute.

> -Chris


More information about the llvm-dev mailing list