[llvm-commits] [gold][patch] Add a pass-through option to the plugin

Rafael Espindola espindola at google.com
Fri Jun 18 12:19:13 PDT 2010


> This sure is a strange problem. The linker asks us what symbols the IR files
> use, we tell it the wrong list (lacking symbols we will use) because we
> can't produce the right one until after we have all the information about
> all native symbols and all the IR files. The linker may have already
> discarded a symbol as unused, only to have it come back to life after
> add_input_file. Would it make sense to hard-code the plugin to tell gold to
> search in libc and libgcc for any symbols that simplify-libcalls or the
> backend may have added?

The problem is that now the plugin would have to be kept updated with
every backend and should have to know what architecture it in running
own.

> That might not work so well for compiler-rt users.
> Would it make sense to have gold iterate on the list of symbols? They
> probably wouldn't like that at all, it would be the same as ignoring the
> order of libraries and .o files on the command line. Maybe we could
> conservatively include every libc/libgcc function our optimizers might add?
> It'd be a pain to maintain.

There was a discussion around those lines during the LTO project, but
the decision in the end was to provide this API so that the linker
doesn't need to know anything special about libgcc or libc (or
compiler-rt, or any other library that libgcc might depend on ...).

> Anyhow, I'm not going to ask you to pursue that (unless you really want to).
> Your fix solves the problem without introducing a big mess for any of the
> pieces.
> Could anyone comment on what Apple's LTO link does about this?

That would be really interesting thing to know!

> Nick

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list