From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15130 invoked by alias); 28 Jan 2011 15:56:23 -0000 Received: (qmail 15118 invoked by uid 22791); 28 Jan 2011 15:56:22 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Jan 2011 15:56:15 +0000 Received: by qwa26 with SMTP id 26so3332170qwa.0 for ; Fri, 28 Jan 2011 07:56:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.95.200 with SMTP id e8mr1043973qcn.213.1296230174027; Fri, 28 Jan 2011 07:56:14 -0800 (PST) Received: by 10.220.184.2 with HTTP; Fri, 28 Jan 2011 07:56:13 -0800 (PST) In-Reply-To: <4D42EEA3020000780002F31E@vpn.id2.novell.com> References: <4D42D7F5020000780002F2D7@vpn.id2.novell.com> <4D42E11A020000780002F2F4@vpn.id2.novell.com> <4D42EEA3020000780002F31E@vpn.id2.novell.com> Date: Fri, 28 Jan 2011 15:56:00 -0000 Message-ID: Subject: Re: discarding rules for duplicate ELF comdat groups From: "H.J. Lu" To: Jan Beulich Cc: binutils@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00375.txt.bz2 On Fri, Jan 28, 2011 at 7:28 AM, Jan Beulich wrote: >>>> On 28.01.11 at 15:40, "H.J. Lu" wrote: >> On Fri, Jan 28, 2011 at 6:30 AM, Jan Beulich wrote: >>>>>> On 28.01.11 at 15:07, "H.J. Lu" wrote: >>>> On Fri, Jan 28, 2011 at 5:51 AM, Jan Beulich wro= te: >>>>> 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. =A0Will its scheme work for you? >>> >>> I'm not aware of any such controls - can you point me to >>> something describing this? >> >> /* COMDAT selection codes. =A0*/ >> >> #define IMAGE_COMDAT_SELECT_NODUPLICATES =A0 =A0 (1) /* Warn if duplicat= es. =A0*/ >> #define IMAGE_COMDAT_SELECT_ANY =A0 =A0 =A0 =A0 =A0 =A0 =A0(2) /* No war= ning. =A0*/ >> #define IMAGE_COMDAT_SELECT_SAME_SIZE =A0 =A0 =A0 =A0(3) /* Warn if diff= erent size. >> */ >> #define IMAGE_COMDAT_SELECT_EXACT_MATCH =A0 =A0 =A0(4) /* Warn if differ= ent. =A0*/ >> #define IMAGE_COMDAT_SELECT_ASSOCIATIVE =A0 =A0 =A0(5) /* Base on other = section. >> */ > > Oh, those you meant. No, they don't allow controlling which > instance will be retained. > You can always propose something. --=20 H.J.