This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: discarding rules for duplicate ELF comdat groups
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 28 Jan 2011 06:07:38 -0800
- Subject: Re: discarding rules for duplicate ELF comdat groups
- References: <4D42D7F5020000780002F2D7@vpn.id2.novell.com>
On Fri, Jan 28, 2011 at 5:51 AM, Jan Beulich <JBeulich@novell.com> wrote:
> It seems like currently the rule simply is to pick the first instance the
> linker gets to see. Wouldn't it make sense to honor the group
> signature's attributed (namely its binding), and prefer keeping an
> instance with a global group signature over a weak or local one?
> That would allow the programmer some control over which
> instance to keep: My main motivation is to find a way to discard
> the various weak fallback functions Linux has to cover cases where
> e.g. some architectures implement certain functionality, while
> others that don't can all use a generic implementation.
>
> I cannot see other mechanisms that would allow ld to discard
> sections (not to speak of individual functions within sections).
>
Microsoft linker has some user controls over which comdat group
instance to keep. Will its scheme work for you?
--
H.J.