From 7fc2793d0663e49a0454da85ff48a621007bd181 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 3 Apr 2009 15:48:00 -0700 Subject: [PATCH] Never use .eh_frame in dwarf_getcfi; only dwarf_getcfi_elf will fetch it. --- libdw/ChangeLog | 5 +++++ libdw/dwarf_begin_elf.c | 3 +-- libdw/dwarf_getcfi.c | 10 +++------- libdw/libdwP.h | 1 - libdw/unwind.h | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index c4ed1a509..05631711e 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2009-04-03 Roland McGrath + + * libdwP.h (IDX_eh_frame): Remove it. + * dwarf_begin_elf.c (dwarf_scnnames): Remove its element. + 2009-04-01 Roland McGrath * dwarf.h: Add DW_CFA_GNU_negative_offset_extended. diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c index aaac39992..391a8b855 100644 --- a/libdw/dwarf_begin_elf.c +++ b/libdw/dwarf_begin_elf.c @@ -1,5 +1,5 @@ /* Create descriptor from ELF descriptor for processing file. - Copyright (C) 2002, 2003, 2004, 2005, 2007 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2002. @@ -70,7 +70,6 @@ static const char dwarf_scnnames[IDX_last][17] = [IDX_debug_aranges] = ".debug_aranges", [IDX_debug_line] = ".debug_line", [IDX_debug_frame] = ".debug_frame", - [IDX_eh_frame] = ".eh_frame", [IDX_debug_loc] = ".debug_loc", [IDX_debug_pubnames] = ".debug_pubnames", [IDX_debug_str] = ".debug_str", diff --git a/libdw/dwarf_getcfi.c b/libdw/dwarf_getcfi.c index 91ac5a473..8f52f36be 100644 --- a/libdw/dwarf_getcfi.c +++ b/libdw/dwarf_getcfi.c @@ -62,14 +62,12 @@ dwarf_getcfi (dbg) if (dbg == NULL) return NULL; - if (dbg->cfi == NULL && (dbg->sectiondata[IDX_debug_frame] != NULL - || dbg->sectiondata[IDX_eh_frame] != NULL)) + if (dbg->cfi == NULL && dbg->sectiondata[IDX_debug_frame] != NULL) { Dwarf_CFI *cfi = libdw_typed_alloc (dbg, Dwarf_CFI); - cfi->eh_frame = dbg->sectiondata[IDX_debug_frame] == NULL; - cfi->data = (Elf_Data_Scn *) dbg->sectiondata[cfi->eh_frame ? IDX_eh_frame - : IDX_debug_frame]; + cfi->eh_frame = false; + cfi->data = (Elf_Data_Scn *) dbg->sectiondata[IDX_debug_frame]; cfi->search_table = NULL; cfi->search_table_vaddr = 0; @@ -79,8 +77,6 @@ dwarf_getcfi (dbg) cfi->frame_vaddr = 0; cfi->textrel = 0; cfi->datarel = 0; - if (cfi->eh_frame) - cfi->frame_vaddr = -1; // XXX .eh_frame sh_addr cfi->e_ident = (unsigned char *) elf_getident (dbg->elf, NULL); cfi->other_byte_order = dbg->other_byte_order; diff --git a/libdw/libdwP.h b/libdw/libdwP.h index 653f829d5..4cccb56cf 100644 --- a/libdw/libdwP.h +++ b/libdw/libdwP.h @@ -84,7 +84,6 @@ enum IDX_debug_aranges, IDX_debug_line, IDX_debug_frame, - IDX_eh_frame, IDX_debug_loc, IDX_debug_pubnames, IDX_debug_str, diff --git a/libdw/unwind.h b/libdw/unwind.h index 272ea9c20..d5169ba7b 100644 --- a/libdw/unwind.h +++ b/libdw/unwind.h @@ -90,8 +90,8 @@ typedef struct Dwarf_Frame_s Dwarf_Frame; /* Opaque type representing a CFI section found in a DWARF or ELF file. */ typedef struct Dwarf_CFI_s Dwarf_CFI; -/* Use the CFI in the DWARF .debug_frame or .eh_frame section. - Returns NULL if there is no such section. +/* Use the CFI in the DWARF .debug_frame section. + Returns NULL if there is no such section (not an error). The pointer returned can be used until dwarf_end is called on DWARF, and must not be passed to dwarf_cfi_end. Calling this more than once returns the same pointer. */ -- 2.47.2