From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3075 invoked by alias); 7 Sep 2009 03:33:35 -0000 Received: (qmail 3064 invoked by uid 22791); 7 Sep 2009 03:33:35 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Sep 2009 03:33:26 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n873XO72017720 for ; Sun, 6 Sep 2009 23:33:24 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n873XJc4018638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 6 Sep 2009 23:33:23 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n873XJfw022668 for ; Mon, 7 Sep 2009 05:33:19 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n873XJDK022667 for binutils@sourceware.org; Mon, 7 Sep 2009 05:33:19 +0200 Date: Mon, 07 Sep 2009 03:33:00 -0000 From: Jan Kratochvil To: binutils@sourceware.org Subject: [patch 2/3] unordered FAILs: .debug_info section alignment (alpha-linux-gnu) Message-ID: <20090907033319.GC20107@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00178.txt.bz2 Hi, alpha-linux-gnu still produces: readelf: Warning: Debug info is corrupted, length of CU at 17 extends beyond end of section (length = 95d70000) As if .debug_info length is odd the section length gets even and readelf tries to interpret the single trailing zero byte as a new CU. Patch makes readelf compliant with DWARF: DWARF3 7.5.2.: On some architectures, there are alignment constraints on section boundaries. To make it easier to pad debugging information sections to satisfy such constraints, the abbreviation code 0 is reserved. Debugging information entries consisting of only the abbreviation code 0 are considered null entries. No regressions found. Thanks, Jan readelf: Warning: Debug info is corrupted, length of CU at 17 extends beyond end of section (length = 95d70000) binutils/ 2009-08-31 Jan Kratochvil * dwarf.c (process_debug_info): Support section padding abbrev codes. binutils/testsuite/ 2009-08-31 Jan Kratochvil * binutils-all/testranges.s (.debug_info): Pad the only CU. --- binutils/dwarf.c 17 Jul 2009 15:19:21 -0000 1.52 +++ binutils/dwarf.c 31 Aug 2009 17:47:37 -0000 @@ -1985,9 +1985,22 @@ process_debug_info (struct dwarf_section abbrev_number = read_leb128 (tags, & bytes_read, 0); tags += bytes_read; - /* A null DIE marks the end of a list of siblings. */ + /* A null DIE marks the end of a list of siblings or it may also be + a section padding. */ if (abbrev_number == 0) { + /* Check if it can be a section padding for the last CU. */ + if (level == 0 && start == end) + { + unsigned char *chk; + + for (chk = tags; chk < start; chk++) + if (*chk != 0) + break; + if (chk == start) + break; + } + --level; if (level < 0) { --- binutils/testsuite/binutils-all/testranges.s-0 2009-08-31 19:44:06.000000000 +0200 +++ binutils/testsuite/binutils-all/testranges.s 2009-08-31 19:47:06.000000000 +0200 @@ -32,6 +32,10 @@ debugS: .uleb128 0x2 ;# (DIE (0x6d) DW_TAG_subprogram) .ascii "A\0" ;# DW_AT_name .4byte range_sub - range ;# DW_AT_ranges + + ;# minimal section alignment on alpha-* is 2, ensure no new invalid CU + ;# will be started. + .balign 2 debugE: .section .debug_abbrev,"",%progbits