[LLVMdev] LTOModule::parseSymbols not handling GlobalAlias

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Oct 7 06:00:55 PDT 2014


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



More information about the llvm-dev mailing list