This is the mail archive of the
mailing list for the binutils project.
Re: Change ld "notice" interface for better handling of indirect symbols
- From: Kyle McMartin <kmcmarti at redhat dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 27 Aug 2014 10:02:13 -0400
- Subject: Re: Change ld "notice" interface for better handling of indirect symbols
- Authentication-results: sourceware.org; auth=none
- References: <20140812123911 dot GJ7047 at bubble dot grove dot modra dot org>
On Tue, Aug 12, 2014 at 10:09:11PM +0930, Alan Modra wrote:
> The main aim of this change was to have non_ir_ref set correctly on
> new indirect symbols. I could have added a "copy" param to the "notice"
> function, so that indirect symbols could be created in plugin_notice,
> but it seemed cleaner to create indirect syms earlier and pass them
> rather than "string" to "notice".
Happily, this seems to resolve an issue building with LTO and ld.bfd...
We had a bug report where building systemd on aarch64 and s390 were
failing with multiply defined symbols (everyone else has gold ported,
which was, for some as yet undebugged by me reason, didn't do this.)
I tried to reduce your patch into something a little more friendly for
2.24 stable, but ran out of time to commit and just slurped it entirely
back into the Fedora binutils tree.
> * bfdlink.h (struct bfd_link_callbacks <notice>): Remove "string"
> param, add "inh".
> * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Only call "notice"
> here when not calling the generic add_symbol function. Formatting.
> Correct handling of indirect symbols. Update notice call.
> * elflink.c (_bfd_elf_notice_as_needed): Update notice call.
> * linker.c (_bfd_generic_link_add_one_symbol): Create indirect
> symbols early. Update notice call. Add comments regarding weak
> symbols vs. indirect.
> * ldmain.c (notice): Update args.
> * plugin.c (plugin_notice): Likewise. Follow warning sym link.
> Handle new indirect symbol.