RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1292230 - ld doesn't resolve symbols in linked to library
Summary: ld doesn't resolve symbols in linked to library
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: Red_Hat_Enterprise_Linux-Release_Notes-7-en-US
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Lenka Špačková
QA Contact:
Vladimír Slávik
Depends On:
TreeView+ depends on / blocked
Reported: 2015-12-16 19:22 UTC by Dave Johansen
Modified: 2019-03-06 00:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Deprecated Functionality
Doc Text:
Symbols from libraries linked as dependencies no longer resolved by *ld* Previously, the *ld* linker resolved any symbols present in any linked library, even if some libraries were linked only implicitly as dependencies of other libraries. This allowed developers to use symbols from the implicitly linked libraries in application code and omit explicitly specifying these libraries for linking. For security reasons, *ld* has been changed to not resolve references to symbols in libraries linked implicitly as dependencies. As a result, linking with *ld* fails when application code attempts to use symbols from libraries not declared for linking and linked only implicitly as dependencies. To use symbols from libraries linked as dependencies, developers must explicitly link against these libraries as well. To restore the previous behavior of *ld*, use the "-copy-dt-needed-entries" command-line option.
Clone Of:
Last Closed: 2018-01-09 10:42:32 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Dave Johansen 2015-12-16 19:22:44 UTC
Description of problem:
In RHEL 6, ld would resolve symbols in a library that were brought in from another library, but this is not the case in RHEL 7.

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

How reproducible:

Steps to Reproduce:
1. Download simple.c from https://github.com/markkilgard/glut/blob/master/progs/examples/simple.c
2. g++ simple.c -lglut -o simple

Actual results:
~> g++ simple.c -lglut -o simple
/usr/bin/ld: /tmp/ccPIpRiP.o: undefined reference to symbol 'glOrtho'
/usr/bin/ld: note: 'glOrtho' is defined in DSO /lib64/libGL.so.1 so try adding it to the linker command line
/lib64/libGL.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

Expected results:
Program links like it did in RHEL 6.

Additional info:
This is a regression from RHEL 6. Right now, the only solution that I know of is to explicitly add the second level libraries in the top level link. This is a painful process that will require a lot of changes to a lot of build processes out there.

Comment 2 Dave Johansen 2015-12-17 05:19:44 UTC
Apparently, this was an intended change:

I just looked through the release notes for RHEL 7 and didn't see anything about this, so could it please be documented, so others don't have to jump through all of the same hurdles that we do.

Comment 3 Jeff Law 2015-12-17 16:19:47 UTC
Correct.  This was an intentional change.  I thought I was documented somewhere already for RHEL 7.  It might be in the developer guide.  I'm reassigning to the doc folks to confirm its location.

Comment 5 Robert Krátký 2017-06-15 16:55:47 UTC
Apologies, this totally slipped through the net. The change should've been documented in the Release Notes for the respective version of RHEL. Unfortunately, that didn't happen, and -- on top of that -- I forgot about this bug. Feel free to yell at me -- that shouldn't have happened.

I'm now reassigning this to the Release Notes component, and we'll figure out how to deal with it. That is, we'll definitely add the info to the 7.2 Release Notes document, but we might also highlight it in the current or upcoming Release Notes. I'll leave that for Lenka's consideration.

Comment 13 Lenka Špačková 2017-10-30 12:36:02 UTC
Thank you all for the input. 

The doc text has been added to Release Notes for Red Hat Enterprise Linux 7.0 through 7.4 and will be carried over in the future minor releases (which we normally do with Deprecated Functionality descriptions).

Comment 16 Nathaniel Groendyk 2018-08-16 20:00:55 UTC
Is it possible to add a linker flag to ES6 to enforce explicit DSO linking (as is default in ES7?)

Comment 17 Nick Clifton 2018-08-17 10:07:57 UTC
(In reply to Nathaniel Groendyk from comment #16)
> Is it possible to add a linker flag to ES6 to enforce explicit DSO linking
> (as is default in ES7?)

Yes.  You can add the "--no-copy-dt-needed-entries" option to the linker command line.  Or if you are invoking the linker via gcc/g++ then "-Wl,--no-copy-dt-needed-entries" should do the trick.

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