[llvm-commits] [llvm] r166239 - in /llvm/trunk/test/BugPoint: crash-narrowfunctiontest.ll metadata.ll remove_arguments_test.ll

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Oct 19 09:47:40 PDT 2012


> The LTO Internalize pass is hiding symbols needed by the bugpoint-passes
> plug-in.  We need to add a flag to control whether Internalize should be run.
> This is a temporary workaround to make these tests pass in the meantime.

I don't understand. Why isn't lto_codegen_add_must_preserve_symbol
preventing the symbol from being internalized? The linker should tell
the internalize pass which symbols must be kept, including because
they show up in a symbol table used by plugins.

This works on ELF:
----------------------------------------------------
$ cat test.c
void func_func_plugin(void) {
}
int main() {
  return 0;
}
$ ./build/bin/clang -Os -c -emit-llvm test.c -o test.o
$ ./build/bin/clang -flto test.o -o no-plugins
$ ./build/bin/clang -Wl,--export-dynamic -flto test.o -o plugins
$ nm plugins  | grep func000000000040076c T func_func_plugin
$ nm no-plugins  | grep func
-----------------------------------------------------

Not how the presence of a symbol table for plugin (because of the
--export-dynamic option) causes LTO to not remove the symbol.

Is this failing on MachO? Could you at least make this hack MachO only?

Cheers,
Rafael



More information about the llvm-commits mailing list