Bug 1403609 - ld: -Wl,--version-script fails to match symbols
Summary: ld: -Wl,--version-script fails to match symbols
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: binutils
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nick Clifton
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1473718
TreeView+ depends on / blocked
 
Reported: 2016-12-11 21:22 UTC by Jan Engelhardt
Modified: 2017-08-08 13:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 13:48:59 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jan Engelhardt 2016-12-11 21:22:39 UTC
Description of problem:
RHEL7 ships with g++ 4.8.x, which is able to compile this C++11 snippet:

 # rh.cpp
 struct K { void f(void) const &; };
 void K::f(void) const & {}

When this K::f function happens to be in a shared library and a -Wl,--version-script file is used,

 # rh.sym
 XYZ { global: extern "C++" { K::*; }; local: *; };

then K::f becomes hidden on RHEL7, because Someone At RedHat™ forgot to update binutils when they updated gcc. (Since binutils bundles libiberty that originates from gcc.)


Version-Release number of selected component (if applicable):
binutils-2.23.52.0.1


How reproducible:
$ g++ rh.cpp -std=gnu++11 -fPIC -shared -Wl,--version-script=rh.sym -o rh.so
$ nm rh.so | grep _Z

Actual results:
- 0000000000000618 t _ZNKR1K1fEv
- Unhappy user
- Programs trying to use rh.so fail at link stage:
  rh.so: undefined reference to `_ZNKR1K1fEv'

Expected results:
- 0000000000000618 T _ZNKR1K1fEv
- Content user

Comment 2 Nick Clifton 2016-12-13 12:53:20 UTC
Hi Jan,

> Version-Release number of selected component (if applicable):
> binutils-2.23.52.0.1

RHEL 7.3 is now using binutils 2.25.1 and it does not exhibit the problem
reported here.  Is this a sufficient solution for you ?

Cheers
  Nick

Comment 4 Jan Engelhardt 2017-08-07 22:37:37 UTC
The issue is fixed with that update.


Note You need to log in before you can comment on or make changes to this bug.