This is the mail archive of the
mailing list for the binutils project.
Re: [patch bfd]: Some adjustments on coff-link.c
- From: Alan Modra <amodra at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 10 Oct 2011 13:38:43 +1030
- Subject: Re: [patch bfd]: Some adjustments on coff-link.c
- References: <CAEwic4ZSFp9mKCOwT=KtBU=DUJ-+iXQWWBpikt1E_4LcUmRuXQ@mail.gmail.com> <CAEwic4a8vsDkcLoOBUBci3wSKd0NehdxfQAaJEC5M7C4ZmxxJw@mail.gmail.com>
On Sun, Oct 09, 2011 at 09:18:25PM +0200, Kai Tietz wrote:
> This patch improves COFF linker for undefined weak symbols
I'm not sure this is a good idea. Unix linkers generally don't
extract an archive member just to satisfy an undefined weak
reference. I know some coff linkers do, but is it better to have GNU
ld consistent across targets, or more compatible with native linkers?
Another issue is that PE has IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY, so
your patch is wrong for that case.
> and avoids writing symbols for discarded sections - if linker tells so
> -, and for IR generated sections.
> 2011-10-09 ?Kai Tietz ?<email@example.com>
> * cofflink.c (coff_link_check_ar_symbols): Allow
> adding of archive-file if symbol was undefined weak.
> (_bfd_coff_write_global_sym): Skip write for symbol
> in discared section, or if section is coming from IR, or
> if input section has explicit SEC_EXCLUDED set.
> (_bfd_coff_generic_relocate_section): For undefined weak
> symbol and replacing it by another undefined weak, mark
> section as absolute.
I'll OK the _bfd_coff_write_global_sym changes, but not the rest of
the patch dealing with undefined weak symbols. A COFF maintainer
needs to decide on that.
Australia Development Lab, IBM