From owner-svn-src-head@FreeBSD.ORG Thu Oct 17 17:25:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 219891F6; Thu, 17 Oct 2013 17:25:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA2872364; Thu, 17 Oct 2013 17:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9HHP0C8024986; Thu, 17 Oct 2013 17:25:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9HHP05j024985; Thu, 17 Oct 2013 17:25:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310171725.r9HHP05j024985@svn.freebsd.org> From: Ed Maste Date: Thu, 17 Oct 2013 17:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256692 - head/contrib/binutils/gas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 17:25:01 -0000 Author: emaste Date: Thu Oct 17 17:25:00 2013 New Revision: 256692 URL: http://svnweb.freebsd.org/changeset/base/256692 Log: Fix .debug_line prologue header length calculation for 64-bit DWARF The header_length field is the number of bytes following the field to the first byte of the line number program. The hard-coded constants previously here (4 + 2 + 4) were correct only for 32-bit DWARF. Sponsored by: DARPA, AFRL Modified: head/contrib/binutils/gas/dwarf2dbg.c Modified: head/contrib/binutils/gas/dwarf2dbg.c ============================================================================== --- head/contrib/binutils/gas/dwarf2dbg.c Thu Oct 17 17:11:15 2013 (r256691) +++ head/contrib/binutils/gas/dwarf2dbg.c Thu Oct 17 17:25:00 2013 (r256692) @@ -1271,6 +1271,7 @@ out_debug_line (segT line_seg) symbolS *line_end; struct line_seg *s; enum dwarf2_format d2f; + int sizeof_initial_length; int sizeof_offset; subseg_set (line_seg, 0); @@ -1287,27 +1288,24 @@ out_debug_line (segT line_seg) d2f = DWARF2_FORMAT (); if (d2f == dwarf2_format_32bit) { - expr.X_add_number = -4; - emit_expr (&expr, 4); - sizeof_offset = 4; + sizeof_initial_length = sizeof_offset = 4; } else if (d2f == dwarf2_format_64bit) { - expr.X_add_number = -12; - out_four (-1); - emit_expr (&expr, 8); + sizeof_initial_length = 12; sizeof_offset = 8; + out_four (-1); } else if (d2f == dwarf2_format_64bit_irix) { - expr.X_add_number = -8; - emit_expr (&expr, 8); - sizeof_offset = 8; + sizeof_initial_length = sizeof_offset = 8; } else { as_fatal (_("internal error: unknown dwarf2 format")); } + expr.X_add_number = -sizeof_initial_length; + emit_expr (&expr, sizeof_offset); /* Version. */ out_two (2); @@ -1316,7 +1314,7 @@ out_debug_line (segT line_seg) expr.X_op = O_subtract; expr.X_add_symbol = prologue_end; expr.X_op_symbol = line_start; - expr.X_add_number = - (4 + 2 + 4); + expr.X_add_number = - (sizeof_initial_length + 2 + sizeof_offset); emit_expr (&expr, sizeof_offset); /* Parameters of the state machine. */