From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25374 invoked by alias); 6 Feb 2014 23:04:32 -0000 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 Received: (qmail 25364 invoked by uid 89); 6 Feb 2014 23:04:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f53.google.com Received: from mail-qa0-f53.google.com (HELO mail-qa0-f53.google.com) (209.85.216.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 06 Feb 2014 23:04:29 +0000 Received: by mail-qa0-f53.google.com with SMTP id cm18so3950525qab.40 for ; Thu, 06 Feb 2014 15:04:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=y6N3PryWAg87IODIPKTaZWE2FkiwMi0yhltMTcMgM5g=; b=ZRt4ypSEwAz3aEWsqHWZA1Rzh5hB/W2c99Y1zUuQL/FmVmRzd+thCyHL67d4ZrL+hE zEuNv8jF7L5ENYH3jc2Yn7lkZL8wRQ8pdmDG3v9URhuCYySFZhPpnBfgFt+Z6rZ3smA+ UIuASObNd5LCOw5U/EtvntpEVqq7HSjl4WZftZCYgLJllwVjPeTzUhgG54tSWuwa/Ufn y0bNVcls86kpK0AdjR8n2MN6M0qqkStp9UTRYtcYrL3fyyUtM8hfu1WnXuGutlfSPbTj QoBOSTuTxyukoPna4sGgtff9WEYqsjjFoyFx5LYxqswm/PI9KpchQvhWihva4O+U/bXN 75iw== X-Gm-Message-State: ALoCoQkJBdchvTtHLpPXz7NDHGisFDh8FZEdDX6PKcGeM3DaVZXsPUv4/eHdUWbBupGVZx7318Q0fpHcOcsksS4Px5JpOk7cRcuPG8vJywFGDRG9sVGXqny1v9ASmbW+B+ZbaaFiW/I6QV5mv9BC7Twi5p2FE3YfxMV3z8VPoefEOGJ0E+O/TPPiosqvDnc38oHyGtomR1H69CkU7eGyiiRmnqQQM0rKMw== MIME-Version: 1.0 X-Received: by 10.224.22.72 with SMTP id m8mr16321937qab.78.1391727807989; Thu, 06 Feb 2014 15:03:27 -0800 (PST) Received: by 10.140.25.205 with HTTP; Thu, 6 Feb 2014 15:03:27 -0800 (PST) In-Reply-To: <20140206223010.GD3596@bubble.grove.modra.org> References: <20140206020434.09251160AB3@ccoutant.mtv.corp.google.com> <20140206223010.GD3596@bubble.grove.modra.org> Date: Thu, 06 Feb 2014 23:04:00 -0000 Message-ID: Subject: Re: [gold commit] Fix problems with --dynamic-list option. From: Cary Coutant To: Cary Coutant , Binutils Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00050.txt.bz2 >> PR gold/16530 complains that symbols listed in the --dynamic-list script >> can still be garbage collected. I've fixed this by checking the symbols >> as they're added to the symbol table. (Unlike the --export-dynamic-symbol >> option, we can't iterate over the list, because the --dynamic-list script >> can have wildcards in it.) > > Should --dynamic-list affect garbage collection? If so, what about > --dynamic-list-cpp-new, --dynamic-list-cpp-new, and --dynamic-list-data? > > I'm thinking the next thing you'll see is a complaint that > --dynamic-list now unexpectedly prevents garbage collection, for > someone using a wildcard in their dynamic-list file. I thought about this, and concluded that --dynamic-list should in fact prevent garbage collection, because the symbols in that list have been explicitly called out (even if via wildcard). The other forms of --dynamic-list-xxx, on the other hand, call for a class of symbol, so I reasoned that they should only affect what's left after garbage collection. I could be wrong. I'm more worried about gold users that have been expecting --dynamic-list to do the wrong thing. After a bit of archeology, I found that the initial implementation in gold was done so it could be used as a file-based version of --export-dynamic-symbol -- i.e., for executables rather than shared libraries. As a result, its implementation w.r.t shared libraries was incomplete, and it was actually possible to use it along with -Bsymbolic, which means that even though the symbols are all exported and called via the PLT, the DT_SYMBOLIC flag is set in the dynamic table, and the dynamic loader is still going to resolve them all within the library. So the old gold behavior is that --dynamic-list with -Bsymbolic preserved -Bsymbolic behavior, while simply forcing each symbol in the list to be exported. I suspect, however, that gold users (at least those within Google) have been using --dynamic-list on executables, and that anyone using it while building a shared library would have noticed the difference between Gnu ld and gold (as PR 13577 did). -cary