Summary: | gold: should the discarded version information warning exist? | ||
---|---|---|---|
Product: | binutils | Reporter: | Raphael Kubo da Costa <raphael.kubo.da.costa> |
Component: | gold | Assignee: | Cary Coutant <ccoutant> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fweimer, ian, jan |
Priority: | P2 | ||
Version: | 2.31 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Raphael Kubo da Costa
2018-07-26 13:47:44 UTC
The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3a12c78d1491c4877928e7294c8cdbe8171dfeed commit 3a12c78d1491c4877928e7294c8cdbe8171dfeed Author: Cary Coutant <ccoutant@gmail.com> Date: Mon Aug 6 14:08:48 2018 -0700 Add --warn-drop-version option; by default, do not warn when discarding version info. gold/ PR gold/23455 * options.h (General_options): Add --warn-drop-version option. * symtab.cc (Symbol_table::set_dynsym_indexes): Check it. The binutils-2_31-branch branch has been updated by Cary Coutant <ccoutant@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b7991db94c9dabb42a7a0fc5b0a0fb1997d85586 commit b7991db94c9dabb42a7a0fc5b0a0fb1997d85586 Author: Cary Coutant <ccoutant@gmail.com> Date: Mon Aug 6 14:08:48 2018 -0700 Add --warn-drop-version option; by default, do not warn when discarding version info. gold/ PR gold/23455 * options.h (General_options): Add --warn-drop-version option. * symtab.cc (Symbol_table::set_dynsym_indexes): Check it. It's still really dangerous to discard the version information. If the symbol ends up being called, the loader will most likely bind the call to the base version, and unpredictable things may happen. In cases where the symbol is merely a canary, like pthread_key_create, it shouldn't matter unless the pthreads library ends up being loaded with the application even though it wasn't linked in. I think you should always link -lpthread with --no-as-needed. The GCC driver ought to be fixed to do this automatically. I'm really not sure why __cxa_finalize triggered the warning -- why would there be a weak reference to it? I've disabled the warning by default, and added a --warn-drop-version option for those who want it. Fixed on trunk and 2.31 branch. (In reply to Cary Coutant from comment #3) > It's still really dangerous to discard the version information. Why is the link editor discarding the symbol version? Shouldn't it create a weak symbol with a weak version reference instead? (Assuming the concern is the strong version reference.) |