summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2009-02-10 17:34:46 -0800
committerUlrich Drepper <[email protected]>2009-02-10 17:34:46 -0800
commit288dfccaeb2129ac5ccab578d171af4a56cc8983 (patch)
tree5810241825094fd972237d66510c007caae8f8a1
parent18fb63988e942f3f7156b46169dbf267631816dc (diff)
parent5453abf2ab7626daeab2506ebc6ed067f5063eb4 (diff)
Merge branch 'master' of ssh://git.fedorahosted.org/git/elfutils
-rw-r--r--libdwfl/ChangeLog12
-rw-r--r--libdwfl/dwfl_report_elf.c6
-rw-r--r--libdwfl/libdwflP.h2
-rw-r--r--libdwfl/link_map.c6
-rw-r--r--libdwfl/offline.c2
5 files changed, 19 insertions, 9 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index ba946c28..11e12a35 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,15 @@
+2009-02-10 Roland McGrath <[email protected]>
+
+ * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
+ If false, don't fail for NO_PHDR.
+ (dwfl_report_elf): Update caller.
+ * libdwflP.h: Update decl.
+ * offline.c (process_elf): Call it with false, so we don't refuse
+ dubiously-formed objects here.
+
+ * link_map.c (consider_executable): Don't assert dwfl_addrsegment
+ finds our module. We shouldn't crash when we confuse some guesses.
+
2009-02-10 Ulrich Drepper <[email protected]>
* open.c (decompress): Avoid crash with empty input file.
diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
index 9fc156fe..a58d3029 100644
--- a/libdwfl/dwfl_report_elf.c
+++ b/libdwfl/dwfl_report_elf.c
@@ -62,7 +62,7 @@
Dwfl_Module *
internal_function
__libdwfl_report_elf (Dwfl *dwfl, const char *name, const char *file_name,
- int fd, Elf *elf, GElf_Addr base)
+ int fd, Elf *elf, GElf_Addr base, bool sanity)
{
GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
if (ehdr == NULL)
@@ -216,7 +216,7 @@ __libdwfl_report_elf (Dwfl *dwfl, const char *name, const char *file_name,
}
}
- if (end == 0)
+ if (end == 0 && sanity)
{
__libdwfl_seterrno (DWFL_E_NO_PHDR);
return NULL;
@@ -284,7 +284,7 @@ dwfl_report_elf (Dwfl *dwfl, const char *name,
}
Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name,
- fd, elf, base);
+ fd, elf, base, true);
if (mod == NULL)
{
elf_end (elf);
diff --git a/libdwfl/libdwflP.h b/libdwfl/libdwflP.h
index 85519498..45eac21c 100644
--- a/libdwfl/libdwflP.h
+++ b/libdwfl/libdwflP.h
@@ -306,7 +306,7 @@ extern int __libdwfl_crc32_file (int fd, uint32_t *resp) attribute_hidden;
Consumes ELF on success, not on failure. */
extern Dwfl_Module *__libdwfl_report_elf (Dwfl *dwfl, const char *name,
const char *file_name, int fd,
- Elf *elf, GElf_Addr base)
+ Elf *elf, GElf_Addr base, bool sanity)
internal_function;
/* Meat of dwfl_report_offline. */
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index e9890384..30fb445a 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -1,5 +1,5 @@
/* Report modules by examining dynamic linker data structures.
- Copyright (C) 2008 Red Hat, Inc.
+ Copyright (C) 2008, 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
@@ -561,9 +561,7 @@ consider_executable (Dwfl_Module *mod, GElf_Addr at_phdr, GElf_Addr at_entry,
void *buffer = NULL;
size_t buffer_available = addrsize (ehdr.e_ident[EI_CLASS]);
- Dwfl_Module *m;
- int segndx = INTUSE(dwfl_addrsegment) (mod->dwfl, d_val_vaddr, &m);
- assert (m == mod);
+ int segndx = INTUSE(dwfl_addrsegment) (mod->dwfl, d_val_vaddr, NULL);
if ((*memory_callback) (mod->dwfl, segndx,
&buffer, &buffer_available,
diff --git a/libdwfl/offline.c b/libdwfl/offline.c
index a80e2928..34aa9f84 100644
--- a/libdwfl/offline.c
+++ b/libdwfl/offline.c
@@ -148,7 +148,7 @@ process_elf (Dwfl *dwfl, const char *name, const char *file_name, int fd,
Elf *elf)
{
Dwfl_Module *mod = __libdwfl_report_elf (dwfl, name, file_name, fd, elf,
- dwfl->offline_next_address);
+ dwfl->offline_next_address, false);
if (mod != NULL)
{
/* If this is an ET_EXEC file with fixed addresses, the address range