[patch] Fix handling of common symbols with plugins

Rafael Espíndola rafael.espindola@gmail.com
Tue Sep 16 15:33:00 GMT 2014


ping.

On 9 September 2014 19:41, Rafael Espíndola <rafael.espindola@gmail.com> wrote:
> Currently we don't produce the correct result if a common symbol shows
> up in both ELF and IR. In a previous patch I tried to pass the size
> information back to the plugin, but unfortunately there is no field in
> d_plugin_symbol to pass the alignment.
>
> What I have implemented now is:
>
> * The plugin is expected to handle all common symbols in IR. It can do
> it by merging them or by passing multiple objects to the linker with
> each symbol.
>
> * The linker will not blindly override a common symbol during the
> replacement phase. Instead, the regular logic is applied so that we
> don't discard information in case an ELF file had the largest size or
> alignment.
>
> In addition to "make check" I tested this with a small script and two
> LLVM IR files. The script test all combinations of input order and
> file type (IR or ELF) and checks that we get the same alignment and
> size.
>
> Cheers,
> Rafael
>
>
> gold
> 2014-09-09  Rafael Ávila de Espíndola <respindola@mozilla.com>
>
>         * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
>         * resolve.cc (Symbol_table::resolve): Don't override common symbols
>         during the replacement phase.
>
> include
> 2014-09-09  Rafael Ávila de Espíndola <respindola@mozilla.com>
>
>         * plugin-api.h (ld_plugin_symbol): Note that size is ignored.
>
> ld
> 2014-09-09  Rafael Ávila de Espíndola <respindola@mozilla.com>
>
>         * plugin.c (asymbol_from_plugin_symbol): Ignore ldsym->size.
>         * testplug.c (parse_symdefstr): Ignore sym->size.



More information about the Binutils mailing list