public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug win32/14527] New: warning: section .gnu_debuglink not found in MODULENAME.debug
@ 2012-08-28 16:53 lrn1986 at gmail dot com
  2012-12-19  8:06 ` [Bug win32/14527] " muhammad_bilal at mentor dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: lrn1986 at gmail dot com @ 2012-08-28 16:53 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14527

             Bug #: 14527
           Summary: warning: section .gnu_debuglink not found in
                    MODULENAME.debug
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: minor
          Priority: P2
         Component: win32
        AssignedTo: unassigned@sourceware.org
        ReportedBy: lrn1986@gmail.com
    Classification: Unclassified


Run this:
gcc -g ./test.c -o ./test.exe
objcopy --only-keep-debug ./test.exe ./test.exe.dbg
objcopy --strip-debug  ./test.exe
objcopy --add-gnu-debuglink="test.exe.dbg" ./test.exe
gdb -ex r -ex q --return-child-result ./test.exe

test.c:
#include <stdio.h>

int main (int argc, char **argv)
{
  printf ("Hello, World!\n");
  return 0;
}

gdb (7.5 from mingw.org) will say:
Reading symbols from PATH_TO\test.exe...Reading symbols from
PATH_TO\test.exe.dbg...
warning: section .gnu_debuglink not found in PATH_TO\test.exe.dbg
done.
done.

Why does gdb warn me about the lack of debuglink in a file with full debug info
(the test.exe.dbg file)? It's not supposed to have that section.

This can be worked around by doing the following:
objcopy --only-keep-debug ./test.exe ./test.exe.dbg
objcopy --add-gnu-debuglink="test.exe.dbg" ./test.exe
objcopy --only-keep-debug ./test.exe ./test.exe.dbg
objcopy --remove-section=.gnu_debuglink ./test.exe
objcopy --strip-debug ./test.exe
objcopy --add-gnu-debuglink="test.exe.dbg" ./test.exe

This way test.exe.gbg file gets a .gnu_debuglink section (doesn't matter where
it's pointing), and its contents pass the CRC32 check

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-02-17 16:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-28 16:53 [Bug win32/14527] New: warning: section .gnu_debuglink not found in MODULENAME.debug lrn1986 at gmail dot com
2012-12-19  8:06 ` [Bug win32/14527] " muhammad_bilal at mentor dot com
2012-12-19 10:21 ` lrn1986 at gmail dot com
2013-03-31  1:06 ` lrn1986 at gmail dot com
2013-03-31  2:26 ` lrn1986 at gmail dot com
2013-03-31  2:29 ` mbilal at codesourcery dot com
2014-04-05  6:46 ` asmwarrior at gmail dot com
2023-02-17 16:47 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).