Bug 14992 - gdb on object file produces: internal error - "Please report this bug"
Summary: gdb on object file produces: internal error - "Please report this bug"
Status: WAITING
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.1
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-01 07:49 UTC by TDHowell
Modified: 2013-01-03 12:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TDHowell 2013-01-01 07:49:35 UTC
I just re-installed gcc and gdb under Windows 7 Professional SP1.
The downloads were these:
mingw-w64-bin_i686-mingw_20111220.zip
x86_64-w64-mingw32-gdb-7.1.90.20100730.zip

I teach a course in which students compile C programs and examine the machine instructions they generate.  I was testing the capability to generate and examine x86_64 code.  The test program is rtsb.c.  It reads a command line argument as a decimal or hex integer prints the bytes representing the argument and its address. 

gcc -m64 -g -c rtsb.c runs and generates rtsb.o

gcc -m64 -g rtsb.c runs and generates a working executable file.
objdump runs fine on either the object file or the executable.

gdb needs to run on the executable file, not the object file, but
I typed the following line in error (should have typed just  gdb rtsb).
gdb rtsb.o   
It creates the following output.

GNU gdb (GDB) 7.1.90.20100730-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from C:\MinGW-w64\home\Tom\cs47prg/rtsb.o...BFD: BFD (GNU Binutils) 2.20.51.20100707 internal error, aborting at ../../gdb-cvs/bfd/reloc.c line 5720 in bfd_generic_get_relocated_section_contents

BFD: Please report this bug.


This is not an important problem for me.  It happens only when I make a typo, but the error message asks for a bug report, so here it is.
Comment 1 Pedro Alves 2013-01-03 12:06:54 UTC
Thanks.

>  GNU gdb (GDB) 7.1.90.20100730-cvs

This is very old by now though.  And, that build was based on a development snapshot, not a release.  It's very likely this issue has been fixed meanwhile.
Could you try a more up to date GDB?