Symbol generation/lookup broken

Bug #825542 reported by Jamie Pocas
62
This bug affects 7 people
Affects Status Importance Assigned to Milestone
gcc-defaults (Ubuntu)
Expired
Low
Unassigned

Bug Description

Description: Ubuntu oneiric (development branch)
Release: 11.10

I have a C++ project that built fine in an up to date Ubuntu 11.04 environment. After I upgraded this system to Ubuntu 11.10 pre-release, I am now receiving a linker error that there is an undefined symbol. The program uses privately built copies of libcurl and libssl and the libssl libraries and sets LD_LIBRARY_PATH appropriately. The -lssl and -lcurl options ARE being passed to g++ in the link step. The private copy of libssl.a DOES contain that symbol that ld is complaining about. I tried swapping out to a known good version of "ld" but with the same results so I am not convinced that the linker is to blame. Also python complains about llibssl.so and libcrypto.so missing version information. I think that perhaps the shared objects are not being built with correct symbols or the loader doesn't understand how to read them. The output of several commands is below. I thought maybe this had something to do with the stricter DSO linking rules but that doesn't explain why the symbol APPEARS in the text section of libssl.a, which I am linking to with -lssl, and yet ld complains that it is undefined.

$make
... truncated for brevity ...
/usr/bin/ld: /home/user1/source/2.8-dev/src/lib/libcurl.so: undefined reference to symbol 'SSL_get_verify_result'
/usr/bin/ld: note: 'SSL_get_verify_result' is defined in DSO /home/user1/source/2.8-dev/src/lib/openssl/lib/libssl.so so try adding it to the linker command line
/home/user1/source/2.8-dev/src/lib/openssl/lib/libssl.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[3]: *** [Target] Error 1
make[2]: *** [obj_d] Error 2
make[1]: *** [Source] Error 2
make: *** [core] Error 2
$ nm lib/openssl/lib/libssl.so | grep SSL_get_verify_result
000000000003a760 T SSL_get_verify_result
$python: /home/user1/source/2.8-dev/src/lib/openssl/lib/libcrypto.so.1.0.0: no version information available (required by python)
python: /home/user1/source/2.8-dev/src/lib/openssl/lib/libssl.so.1.0.0: no version information available (required by python)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: g++ 4:4.6.1-2ubuntu3
ProcVersionSignature: Ubuntu 3.0.0-8.10-generic 3.0.1
Uname: Linux 3.0.0-8-generic x86_64
Architecture: amd64
Date: Fri Aug 12 17:33:32 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gcc-defaults
UpgradeStatus:
 Upgraded to /usr/bin/python3: /home/jpocas/source/2.8-dev/src/lib/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/python3)
 /usr/bin/python3: /home/jpocas/source/2.8-dev/src/lib/openssl/lib/libssl.so.1.0.0: no version information available (required by /usr/bin/python3)
 oneiric on 2011-08-10 (1 days ago)

Tags: g++ gcc ld
Revision history for this message
Jamie Pocas (pocas-jamie) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-defaults (Ubuntu):
status: New → Confirmed
Revision history for this message
Andreas Moog (ampelbein) wrote :

This is most likely a direct consequence of oneiric passing --no-add-needed (--no-copy-dt-needed-entries) to the linker. See http://wiki.debian.org/ToolChain/DSOLinking. Also, argument order matters. Can you show the complete command passed to the linker?

Changed in gcc-defaults (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
Jamie Pocas (pocas-jamie) wrote :

Here is the key to the issue.

/home/user1/source/2.8-dev/src/lib/openssl/lib/libssl.so: could not read symbols: Invalid operation

I was linking to the shared object as specified on the DSO linking page. The problem was that when the linker ran I was getting "Invalid operation". The .so was being built with broken symbols somehow. This was fixed with some subsequent binutils and did not occur with the the version that shipped with Ubuntu 11.10 final. I think this can be closed now.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gcc-defaults (Ubuntu) because there has been no activity for 60 days.]

Changed in gcc-defaults (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.