From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15154 invoked by alias); 1 Jul 2011 18:01:46 -0000 Received: (qmail 14947 invoked by uid 22791); 1 Jul 2011 18:01:44 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 18:01:30 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 61F132BACF2; Fri, 1 Jul 2011 14:01:29 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id b0gSsIKeC05h; Fri, 1 Jul 2011 14:01:29 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2E94B2BACD8; Fri, 1 Jul 2011 14:01:29 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5C260145615; Fri, 1 Jul 2011 11:01:27 -0700 (PDT) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [RFA/DWARF] Do not load .eh_frame section from separete object files Date: Fri, 01 Jul 2011 18:01:00 -0000 Message-Id: <1309543276-15291-1-git-send-email-brobecker@adacore.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00035.txt.bz2 From: Joel Brobecker We don't need to read the .eh_frame section from the separate object files, because this data is already present in the main executable (it needs to, or the program wouldn't work). We discovered this investigating a problem with the 'next' command, which was due to unwind failures, which came from the fact that the .eh_frame was incorrectly relocated. That problem is mostly under control, I think, but this is a nice optimization in any case. gdb/ChangeLog (Tristan Gingold): * dwarf2-frame.c (dwarf2_build_frame_info): Do not load .eh_frame section in separate object files. Tested on x86_64-linux as well as x86_64-darwin. OK to commit? Thanks, -- Joel --- gdb/dwarf2-frame.c | 67 ++++++++++++++++++++++++++++------------------------ 1 files changed, 36 insertions(+), 31 deletions(-) diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 5df3488..b68a773 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -2227,39 +2227,44 @@ dwarf2_build_frame_info (struct objfile *objfile) unit->dbase = 0; unit->tbase = 0; - dwarf2_get_section_info (objfile, DWARF2_EH_FRAME, - &unit->dwarf_frame_section, - &unit->dwarf_frame_buffer, - &unit->dwarf_frame_size); - if (unit->dwarf_frame_size) + if (objfile->separate_debug_objfile_backlink == NULL) { - asection *got, *txt; - - /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base - that is used for the i386/amd64 target, which currently is - the only target in GCC that supports/uses the - DW_EH_PE_datarel encoding. */ - got = bfd_get_section_by_name (unit->abfd, ".got"); - if (got) - unit->dbase = got->vma; - - /* GCC emits the DW_EH_PE_textrel encoding type on sh and ia64 - so far. */ - txt = bfd_get_section_by_name (unit->abfd, ".text"); - if (txt) - unit->tbase = txt->vma; - - frame_ptr = unit->dwarf_frame_buffer; - while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size) - frame_ptr = decode_frame_entry (unit, frame_ptr, 1, - &cie_table, &fde_table); - - if (cie_table.num_entries != 0) + /* Do not read .eh_frame from separate file as they must be also + present in the main file. */ + dwarf2_get_section_info (objfile, DWARF2_EH_FRAME, + &unit->dwarf_frame_section, + &unit->dwarf_frame_buffer, + &unit->dwarf_frame_size); + if (unit->dwarf_frame_size) { - /* Reinit cie_table: debug_frame has different CIEs. */ - xfree (cie_table.entries); - cie_table.num_entries = 0; - cie_table.entries = NULL; + asection *got, *txt; + + /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base + that is used for the i386/amd64 target, which currently is + the only target in GCC that supports/uses the + DW_EH_PE_datarel encoding. */ + got = bfd_get_section_by_name (unit->abfd, ".got"); + if (got) + unit->dbase = got->vma; + + /* GCC emits the DW_EH_PE_textrel encoding type on sh and ia64 + so far. */ + txt = bfd_get_section_by_name (unit->abfd, ".text"); + if (txt) + unit->tbase = txt->vma; + + frame_ptr = unit->dwarf_frame_buffer; + while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size) + frame_ptr = decode_frame_entry (unit, frame_ptr, 1, + &cie_table, &fde_table); + + if (cie_table.num_entries != 0) + { + /* Reinit cie_table: debug_frame has different CIEs. */ + xfree (cie_table.entries); + cie_table.num_entries = 0; + cie_table.entries = NULL; + } } } -- 1.7.1