[LLVMdev] LTOModule::parseSymbols not handling GlobalAlias

Rafael Espíndola
Tue, 07 Oct 2014 13:00:55 -0000

On 2 October 2014 12:35, Shankar Easwaran <shankare at codeaurora.org>
wrote:
> Hi,
>
> There is a genuine case that lto_module_get_num_symbols doesnot return all
> the symbols that are in the bitcode file.
>
> Test case:-
>
> cat > test.c << \!
> int bar() { return 0; }
> int foo()  __attribute__ ((weak, alias ("bar")));
> !
>
> clang -c test.c -emit-llvm
>
> Use a program to list all the symbols using lto_module_get_num_symbols, and
> foo will be missing from the list.

I can't reproduce this. If a run

llvm-lto -dso-symbol bar -dso-symbol foo test.o -o out.o

I do get both symbols in the output. Setting a breakpoint in
llvm-lto.cpp:154 also shows NumSyms being 2.

Cheers,
Rafael