SHA256
1
0
forked from pool/elfutils
OBS User unknown 2009-01-08 17:03:09 +00:00 committed by Git OBS Bridge
parent 57f31c0794
commit 4c94e0c162
4 changed files with 85 additions and 2 deletions

View File

@ -0,0 +1,16 @@
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index 9b3c97a..54c17f8 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -337,8 +337,11 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
/* Consistency check. */
if (unlikely (linep != header_start + header_length))
{
+#if 0
__libdw_seterrno (DWARF_E_INVALID_DWARF);
goto out;
+#endif
+ linep = header_start + header_length;
}
/* We are about to process the statement program. Initialize the

View File

@ -0,0 +1,54 @@
commit 7d9b821db6bc494417a57321b419c6b9481a2128
Author: Roland McGrath <roland@redhat.com>
Date: Thu Dec 18 15:08:09 2008 -0800
Fix last fix: ET_DYN addresses are taken as relative to MOD->low_addr.
* derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
addresses are taken as relative to MOD->low_addr.
---
diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c
index 7f390c7..f2a6467 100644
--- a/libdwfl/derelocate.c
+++ b/libdwfl/derelocate.c
@@ -238,6 +238,7 @@ dwfl_module_relocations (Dwfl_Module *mod)
return 1;
case ET_EXEC:
+ assert (mod->main.bias == 0);
assert (mod->debug.bias == 0);
break;
}
@@ -353,16 +354,26 @@ find_section (Dwfl_Module *mod, Dwarf_Addr *addr)
int
dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr)
{
- if (check_module (mod))
+ if (unlikely (check_module (mod)))
return -1;
- if (mod->e_type != ET_REL)
+ switch (mod->e_type)
{
- *addr -= mod->main.bias;
- return 0;
+ case ET_REL:
+ return find_section (mod, addr);
+
+ case ET_DYN:
+ /* All relative to first and only relocation base: module start. */
+ *addr -= mod->low_addr;
+ break;
+
+ default:
+ /* Already absolute, dwfl_module_relocations returned zero. We
+ shouldn't really have been called, but it's a harmless no-op. */
+ break;
}
- return find_section (mod, addr);
+ return 0;
}
INTDEF (dwfl_module_relocate_address)

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 7 15:01:10 CET 2009 - tiwai@suse.de
- Fix the header size check in dwarf_getsrclines() (bnc#455992)
- Backport the fix for ET_DYN addresses
-------------------------------------------------------------------
Tue Dec 16 13:48:38 CET 2008 - tiwai@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package elfutils (Version 0.137)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,7 +21,7 @@
Name: elfutils
License: GPL v2 or later
Version: 0.137
Release: 4
Release: 5
Summary: Higher-level library to access ELF
Group: System/Libraries
Url: http://elfutils.fedorahosted.org
@ -41,6 +41,8 @@ Patch22: elfutils-0.137-i386-rel-types.diff
Patch23: elfutils-0.137-readelf-crash-fix.diff
Patch24: elfutils-0.137-nm-crash-fix.diff
Patch25: elfutils-0.137-main-bias-fix.diff
Patch26: elfutils-0.137-main-bias-fix2.diff
Patch27: elfutils-0.137-dwarf-header-check-fix.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -211,6 +213,8 @@ Authors:
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%build
autoreconf -fi
@ -291,6 +295,9 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/elfutils/libdwfl.h
%changelog
* Wed Jan 07 2009 tiwai@suse.de
- Fix the header size check in dwarf_getsrclines() (bnc#455992)
- Backport the fix for ET_DYN addresses
* Tue Dec 16 2008 tiwai@suse.de
- Fix dwfl_getmodules(), assert in systemtap (bnc#448331)
- Fix libebl1 dependency