From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25650 invoked by alias); 22 Apr 2015 19:33:09 -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 25636 invoked by uid 89); 22 Apr 2015 19:33:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f52.google.com Received: from mail-yh0-f52.google.com (HELO mail-yh0-f52.google.com) (209.85.213.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 22 Apr 2015 19:33:07 +0000 Received: by yhcb70 with SMTP id b70so27576512yhc.0 for ; Wed, 22 Apr 2015 12:33:05 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.236.110.163 with SMTP id u23mr16534968yhg.50.1429731185307; Wed, 22 Apr 2015 12:33:05 -0700 (PDT) Received: by 10.129.92.10 with HTTP; Wed, 22 Apr 2015 12:33:05 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Apr 2015 19:33:00 -0000 Message-ID: Subject: Re: Patch to not create GOT and dynamic relocation entries for unresolved symbols with --warn-unresolved-symbols. From: Cary Coutant To: Sriraman Tallam Cc: "H.J. Lu" , binutils , Paul Pluzhnikov , Rong Xu , Brooks Moses , Ollie Wild , David Li , Teresa Johnson , Ian Lance Taylor Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00326.txt.bz2 * options.h (--warn-unresolved-symbols): New option. s/warn/weak/ * symtab.cc (Symbol_table::sized_write_globals): Change symbol binding to weak with new option. * symtab.h (is_weak_undefined): Check for new option. (is_strong_undefined): Check for new option. * testsuite/Makefile.am(weak_unresolved_symbols_test): New test. * testsuite/Makefile.in: Regenerate. * testsuite/weak_unresolved_symbols_test.cc: New file. This file is missing from the patch. (Don't forget to "git add".) * Makefile.in: Side-effect from running automake. Since you didn't change Makefile, just remove this from the patch ("git checkout Makefile" after running automake). Otherwise, we'll keep ping-ponging uselessly between the two (or more) variations that automake generates. + // If --weak-unresolved-symbols is set, change binding of unresolved + // global symbols to STB_WEAK. + if (parameters->options().weak_unresolved_symbols() + && (binding == elfcpp::STB_GLOBAL + || binding == elfcpp::STB_LOCAL) Why check for STB_LOCAL? Local symbols can't be unresolved. What about STB_GNU_UNIQUE symbols? (Perhaps that's what you meant.) -cary