This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Fix handling of common symbols with plugins
- From: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Cary Coutant <ccoutant at google dot com>
- Date: Tue, 16 Sep 2014 11:33:25 -0400
- Subject: Re: [patch] Fix handling of common symbols with plugins
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jRe+9-c3erPGakOydZfpEZAD5Fw=bEP1EV7MyFFp33wApQQ at mail dot gmail dot com>
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.