From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29103 invoked by alias); 3 Jul 2012 08:26:20 -0000 Received: (qmail 29039 invoked by uid 22791); 3 Jul 2012 08:26:15 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Jul 2012 08:26:00 +0000 Received: by pbbrp2 with SMTP id rp2so9958709pbb.0 for ; Tue, 03 Jul 2012 01:26:00 -0700 (PDT) Received: by 10.68.226.38 with SMTP id rp6mr5110061pbc.90.1341303960194; Tue, 03 Jul 2012 01:26:00 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id jv6sm15076588pbc.40.2012.07.03.01.25.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 01:25:59 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D6811EA0322; Tue, 3 Jul 2012 17:55:53 +0930 (CST) Date: Tue, 03 Jul 2012 08:26:00 -0000 From: Alan Modra To: "H.J. Lu" Cc: binutils@sourceware.org, GNU C Library Subject: Re: PATCH: Add STB_SECONDARY support Message-ID: <20120703082553.GE16148@bubble.grove.modra.org> Mail-Followup-To: "H.J. Lu" , binutils@sourceware.org, GNU C Library References: <20120630211841.GA4159@intel.com> <20120702062405.GJ25209@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-07/txt/msg00038.txt.bz2 On Mon, Jul 02, 2012 at 06:31:34AM -0700, H.J. Lu wrote: > The main usage is > > 1. ISV defines a secondary symbol in a library. > 2. The library with a secondary symbol is used by programmers. > > #1 and #2 are different people. ISV has no control over > the command line used by programmers. We need > a reliable solution which is transparent to programmers, It sounds to me that the best solution would be to define a way of marking an archive that instructs the linker to link it last regardless of where it is placed on the command line, then just use weak symbols. This has the added benefit that your backup implementations will be included on an object file granularity, which is likely to be the simplest and most useful model. Also, this should work with PE and other object formats rather than being ELF only. Options for marking the archive are - A new magic string to replace "!\012", as we did for thin archives. - A special file name in the archive, similar to the way extended file names are recognized. - A magic symbol in the armap. I'm not sure which is best. -- Alan Modra Australia Development Lab, IBM