Bug 510958 - Overlapping .debug_ranges (C++)
Overlapping .debug_ranges (C++)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc44 (Show other bugs)
5.4
All Linux
low Severity low
: rc
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: 509124
  Show dependency treegraph
 
Reported: 2009-07-12 16:52 EDT by Jan Kratochvil
Modified: 2011-01-13 19:00 EST (History)
5 users (show)

See Also:
Fixed In Version: gcc44-4.4.4-13.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 509124
Environment:
Last Closed: 2011-01-13 19:00:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ascend.C reproducer from the customer. (108 bytes, text/plain)
2009-07-12 16:52 EDT, Jan Kratochvil
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 40713 None None None Never

  None (edit)
Description Jan Kratochvil 2009-07-12 16:52:44 EDT
Created attachment 351404 [details]
ascend.C reproducer from the customer.

+++ This bug was initially created as a clone of Bug #509124 +++

--- Additional comment from jan.kratochvil@redhat.com on 2009-07-09 15:52:36 EDT ---

(2) [->gcc]
Another problem is with the content of .debug_ranges offset 0x60 (DW_TAG_compile_unit).

eu-readelf displays these cases correctly - shown on an executable (not an object file) as the relocations get resolved there and it gets more visible:

DWARF section [35] '.debug_ranges' at offset 0x1190:
 [     0]  0x00000000004006bd <_ZN1CC2Ev+0x11>..0x00000000004006e5 <_ZN1CC2Ev+0x39>
           0x00000000004006f6 <_ZN1CC2Ev+0x4a>..0x000000000040070c <_ZN1CC1Ev>
 [    30]  0x000000000040071d <_ZN1CC1Ev+0x11>..0x0000000000400745 <_ZN1CC1Ev+0x39>
           0x0000000000400756 <_ZN1CC1Ev+0x4a>..0x000000000040076c <_ZN1A1fEv>
 [    60]  0x00000000004006ac <_ZN1CC2Ev>..0x000000000040076c <_ZN1A1fEv>
           0x000000000040076c <_ZN1A1fEv>..0x0000000000400776
           0x00000000004006ac <_ZN1CC2Ev>..0x000000000040070c <_ZN1CC1Ev>
           0x000000000040070c <_ZN1CC1Ev>..0x000000000040076c <_ZN1A1fEv>


One can see a real target binary problem in this case - the offset 0x60 has overlapping entries.  This is forbidden by DWARF3:
    http://dwarf.freestandards.org/Dwarf3.pdf 2.17.3
    Address range entries in a range list may not overlap.

This problem is reproducible on: gcc43-c++-4.3.2-7.el5.x86_64
This problem is reproducible on: gcc44-c++-4.4.0-6.el5.x86_64
But it is not reproducible on: gcc-c++-4.1.2-44.el5.x86_64

GCC produces:
        .quad   .Ltext0 # Offset 0x60
        .quad   .Letext0
        .quad   .LFB2   # Offset 0x70
        .quad   .LFE2
        .quad   .LFB5   # Offset 0x80
        .quad   .LFE5
        .quad   .LFB4   # Offset 0x90
        .quad   .LFE4
        .quad   0x0
        .quad   0x0

but .LFB5 .. .LFE5 and .LFB4 .. .LFE4 lay inside .text (.Ltext0 .. .Letext0).

This problem produces the readelf message:
readelf: Warning: There is an overlap [0xb0 - 0x0] in .debug_ranges section.


Fixed by Jakub upstream:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40713#c2

Requested as a part of the binutils Bug 509124 - issue 313140.
Comment 1 Jakub Jelinek 2009-07-13 11:09:22 EDT
As the fix already is in redhat/gcc-4_4-branch, it will be automatically solved when gcc44 is updated.
Comment 2 RHEL Product and Program Management 2009-11-06 13:46:50 EST
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 7 errata-xmlrpc 2011-01-13 19:00:14 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0102.html

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