This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Patch to not create GOT and dynamic relocation entries for unresolved symbols with --warn-unresolved-symbols.
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils <binutils at sourceware dot org>, Paul Pluzhnikov <ppluzhnikov at google dot com>, Rong Xu <xur at google dot com>, Brooks Moses <bmoses at google dot com>, Ollie Wild <aaw at google dot com>, David Li <davidxl at google dot com>, Teresa Johnson <tejohnson at google dot com>, Ian Lance Taylor <iant at google dot com>
- Date: Wed, 22 Apr 2015 12:33:05 -0700
- Subject: Re: Patch to not create GOT and dynamic relocation entries for unresolved symbols with --warn-unresolved-symbols.
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8Hmxe3fNV-7MLyNhk_=DOaR91-s=dFw3E-cFdqCCiGxxreA at mail dot gmail dot com> <CAJimCsG4yZAA1o-_nVEWH=9DwBjQZiCwDGQzNcDa+GY_XbMwvw at mail dot gmail dot com> <CAMe9rOr4SgwoF7Y-dpFogchwqpVK5z0DyYn9S9m1ZXJdu-2U4g at mail dot gmail dot com> <CAAs8Hmw2USAPrpxucvp0oE_5kidHde1-nYz7Q-YKWzpdn+L0ow at mail dot gmail dot com>
* 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