From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130384 invoked by alias); 1 Mar 2015 05:22:56 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 130361 invoked by uid 48); 1 Mar 2015 05:22:54 -0000 From: "noloader at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/18065] New: GDB does not honor Debug Information File listed in gnu_debuglink Date: Sun, 01 Mar 2015 05:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: noloader at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00355.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18065 Bug ID: 18065 Summary: GDB does not honor Debug Information File listed in gnu_debuglink Product: gdb Version: 7.7 Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: noloader at gmail dot com It appears GDB does not honor the debug information file name placed in gnu_debuglink. The digest is I have a library installed in /usr/local/lib, and I can't get GDB to load its symbols that were placed in /usr/lib/debug. The remainder are the symptoms I am seeing. ********** I'm building the Crypto++ library. The library will be installed in /usr/local/lib as libcryptopp.so. After make'ing but before installing, I use objcopy and strip to create the two part executable file - the stripped executable, and its debug information file. The debug information file is named libcryptopp.so.debug. Here are the commands used: cd cryptopp make static dynamic cryptest.exe DEBUG_SYM_DIR=/usr/lib/debug objcopy --only-keep-debug libcryptopp.so libcryptopp.so.debug strip --strip-debug --strip-unneeded libcryptopp.so sudo cp libcryptopp.so.debug $(DEBUG_SYM_DIR)/ objcopy --add-gnu-debuglink=$(DEBUG_SYM_DIR)/libcryptopp.so.debug libcryptopp.so According to objcopy(1), gnu_debuglink should include the full path (https://sourceware.org/binutils/docs/binutils/objcopy.html): --add-gnu-debuglink=path-to-file Creates a .gnu_debuglink section which contains a reference to path-to-file and adds it to the output file. After performing make, objcopy, strip and install: $ ls -l /usr/local/lib/libcryptopp.so -rwxr-xr-x 1 root root 4837488 Feb 28 23:54 /usr/local/lib/libcryptopp.so $ file /usr/local/lib/libcryptopp.so /usr/local/lib/libcryptopp.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=94b358780db21ff9b02b44ac65214ec9b855f72b, stripped $ file /usr/lib/debug/cryptopp/libcryptopp.so.debug /usr/lib/debug/cryptopp/libcryptopp.so.debug: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=94b358780db21ff9b02b44ac65214ec9b855f72b, not stripped $ ls -l /usr/lib/debug/cryptopp/libcryptopp.so.debug -rwxr-xr-x 1 root root 17757127 Mar 1 00:09 /usr/lib/debug/cryptopp/libcryptopp.so.debug $ objdump -h /usr/local/lib/libcryptopp.so ... 27 .gnu_debuglink 0000001c 0000000000000000 0000000000000000 0049c7ac 2**0 CONTENTS, READONLY I don't know how to ask objdump or readelf to print a section's details, so about all I can do is dump strings (forgive my ignorance): $ strings /usr/local/lib/libcryptopp.so | grep libcryptopp libcryptopp.so.debug When I attempt to load Crypto++: (gdb) file /usr/local/lib/libcryptopp.so Reading symbols from /usr/local/lib/libcryptopp.so...(no debugging symbols found)...done. $ gdb GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. ... (gdb) file /usr/local/lib/libcryptopp.so Reading symbols from /usr/local/lib/libcryptopp.so...(no debugging symbols found)...done. ... -- You are receiving this mail because: You are on the CC list for the bug.