From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16641 invoked by alias); 4 Feb 2011 21:21:04 -0000 Received: (qmail 16632 invoked by uid 22791); 4 Feb 2011 21:21:03 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from dm-mail01.mozilla.org (HELO dm-mail01.mozilla.org) (63.245.208.150) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Feb 2011 21:20:58 +0000 Received: from [10.240.2.241] (v74-nslb.mozilla.org [10.2.74.4]) (Authenticated sender: respindola@mozilla.com) by dm-mail01.mozilla.org (Postfix) with ESMTP id 243AC6A889A; Fri, 4 Feb 2011 13:20:56 -0800 (PST) Message-ID: <4D4C6DB4.8020407@mozilla.com> Date: Fri, 04 Feb 2011 21:21:00 -0000 From: Rafael Avila de Espindola User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: binutils@sourceware.org CC: iant@google.com, dnovillo@google.com Subject: [patch] Use LDPR_PREVAILING_DEF for symbols in -u Content-Type: multipart/mixed; boundary="------------050706030204020904080100" 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-02/txt/msg00049.txt.bz2 This is a multi-part message in MIME format. --------------050706030204020904080100 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-length: 483 Using the gold plugin I noticed that symbols passed to -u were still reported as LDPR_PREVAILING_DEF_IRONLY. I believe the correct behaviour would be to return LDPR_PREVAILING_DEF. This is useful for example for letting the linker (and therefore the compiler) know of references that exist only in inline assembly. 2010-02-04 Rafael Ávila de Espíndola * plugin.cc (is_visible_from_outside): Return true for symbols in the -u option. Cheers, Rafael --------------050706030204020904080100 Content-Type: text/x-patch; name="gold-plugin-u.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gold-plugin-u.patch" Content-length: 471 diff --git a/gold/plugin.cc b/gold/plugin.cc index 9c444c2..214eff3 100644 --- a/gold/plugin.cc +++ b/gold/plugin.cc @@ -699,6 +699,8 @@ is_visible_from_outside(Symbol* lsym) return true; if (parameters->options().relocatable()) return true; + if (parameters->options().is_undefined(lsym->name())) + return true; if (parameters->options().export_dynamic() || parameters->options().shared()) return lsym->is_externally_visible(); return false; --------------050706030204020904080100--