From: Roland McGrath Date: Sun, 29 Mar 2009 23:33:20 +0000 (-0700) Subject: Fix .eh_frame CFI finding when there is a separate debug file without .debug_frame. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f70b0d176c040926fa2711da92ec19966cfd201;p=thirdparty%2Felfutils.git Fix .eh_frame CFI finding when there is a separate debug file without .debug_frame. --- diff --git a/libdwfl/dwfl_module_getcfi.c b/libdwfl/dwfl_module_getcfi.c index 816b49395..b1d5831c3 100644 --- a/libdwfl/dwfl_module_getcfi.c +++ b/libdwfl/dwfl_module_getcfi.c @@ -1,5 +1,5 @@ /* Find CFI for a module in libdwfl. - Copyright (C) 2006, 2007 Red Hat, Inc. + Copyright (C) 2006, 2007, 2009 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -61,15 +61,13 @@ dwfl_module_getcfi (mod, bias) if (mod->cfi == NULL) { - Elf *elf = INTUSE(dwfl_module_getelf) (mod, bias); - if (elf != NULL) + mod->cfi = INTUSE(dwarf_getcfi) (INTUSE(dwfl_module_getdwarf) (mod, + bias)); + if (mod->cfi == NULL && mod->main.elf != NULL) { - Dwarf *dw = INTUSE(dwfl_module_getdwarf) (mod, bias); - mod->cfi_elf = dw == NULL; - mod->cfi = (mod->cfi_elf ? INTUSE(dwarf_getcfi_elf) (elf) - : INTUSE(dwarf_getcfi) (dw)); - if (mod->cfi == NULL) - __libdwfl_seterrno (DWFL_E_LIBDW); + mod->cfi_elf = true; + *bias = mod->main.bias; + mod->cfi = INTUSE(dwarf_getcfi_elf) (mod->main.elf); } if (mod->cfi != NULL && mod->cfi->ebl == NULL)