OBS User unknown 2008-10-23 20:18:30 +00:00 committed by Git OBS Bridge
parent 2028891db1
commit 57a3b24e28
4 changed files with 84 additions and 39 deletions

View File

@ -1,10 +1,15 @@
---
tools/debugedit.c | 137 +++++++++++++++++++++++++++---------------------------
1 file changed, 70 insertions(+), 67 deletions(-)
Subject: Fix path canonicalization issues in debugedit
Index: b/tools/debugedit.c
This patch fixes multiple problems with path canonicalization in
debugedit. This version of debugedit is taken from the dwarftools repository.
---
tools/debugedit.c | 165 ++++++++++++++++++++++++++----------------------------
1 file changed, 82 insertions(+), 83 deletions(-)
Index: tools/debugedit.c
===================================================================
--- tools/debugedit.c
--- tools/debugedit.c.orig
+++ tools/debugedit.c
@@ -471,13 +471,13 @@ has_prefix (const char *str,
{
@ -22,7 +27,7 @@ Index: b/tools/debugedit.c
return strncmp (str, prefix, prefix_len) == 0;
}
@@ -485,7 +485,7 @@ static int
@@ -485,9 +485,10 @@ static int
edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase)
{
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
@ -30,8 +35,11 @@ Index: b/tools/debugedit.c
+ char **dirt;
unsigned char *endsec = ptr + debug_sections[DEBUG_LINE].size;
unsigned char *endcu, *endprol;
+ char line_base;
unsigned char opcode_base;
@@ -496,9 +496,9 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
uint_32 value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
@@ -496,9 +497,9 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
if (phase != 0)
return 0;
@ -43,7 +51,7 @@ Index: b/tools/debugedit.c
endcu = ptr + 4;
endcu += read_32 (ptr);
if (endcu == ptr + 0xffffffff)
@@ -521,7 +521,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -521,7 +522,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
value);
return 1;
}
@ -52,12 +60,13 @@ Index: b/tools/debugedit.c
endprol = ptr + 4;
endprol += read_32 (ptr);
if (endprol > endcu)
@@ -530,26 +530,26 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -530,26 +531,27 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
dso->filename);
return 1;
}
-
+
+ line_base = (char) (ptr[2] & 0xff);
opcode_base = ptr[4];
ptr = dir = ptr + 4 + opcode_base;
-
@ -85,7 +94,7 @@ Index: b/tools/debugedit.c
}
ptr++;
@@ -559,8 +559,8 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -559,8 +561,8 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
char *s, *file;
size_t file_len, dir_len;
@ -96,7 +105,7 @@ Index: b/tools/debugedit.c
value = read_uleb128 (ptr);
if (value >= dirt_cnt)
@@ -629,7 +629,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -629,7 +631,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
}
free (s);
@ -105,7 +114,7 @@ Index: b/tools/debugedit.c
read_uleb128 (ptr);
read_uleb128 (ptr);
}
@@ -661,7 +661,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -661,7 +663,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
if (dest_dir)
{
@ -114,7 +123,7 @@ Index: b/tools/debugedit.c
size_t base_len = strlen (base_dir);
size_t dest_len = strlen (dest_dir);
size_t shrank = 0;
@@ -675,12 +675,16 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -675,12 +677,16 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
ptr = dir;
}
else
@ -135,7 +144,7 @@ Index: b/tools/debugedit.c
if (*srcptr == '/' && has_prefix (srcptr, base_dir))
{
@@ -689,24 +693,28 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
@@ -689,39 +695,28 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
memcpy (ptr, dest_dir, dest_len);
ptr += dest_len;
readptr += base_len;
@ -149,9 +158,11 @@ Index: b/tools/debugedit.c
+ canonicalize_path (readptr, (char *)ptr);
+ len = strlen ((char *)ptr);
+
+/*
+ if ((srcptr - readptr) > len)
+ error(0, 0,"canonicalization unexpectedly shrank (%lu): \"%s\"\n",
+ (long unsigned int)(srcptr - readptr) - len, ptr);
+*/
+
shrank -= len;
ptr += len;
@ -159,21 +170,35 @@ Index: b/tools/debugedit.c
- elf_flagdata (debug_sections[DEBUG_STR].elf_data,
- ELF_C_SET, ELF_F_DIRTY);
- }
-
- if (shrank > 0)
- {
- if (--shrank == 0)
- error (EXIT_FAILURE, 0,
- "canonicalization unexpectedly shrank by one character");
- memset (ptr, 'X', shrank);
- ptr += shrank;
- *ptr++ = '\0';
+ elf_flagdata (debug_sections[DEBUG_STR].elf_data,
+ ELF_C_SET, ELF_F_DIRTY);
+ ++ptr;
+ ++srcptr;
+ }
}
if (shrank > 0)
{
- if (--shrank == 0)
- error (EXIT_FAILURE, 0,
- "canonicalization unexpectedly shrank by one character");
memset (ptr, 'X', shrank);
ptr += shrank;
*ptr++ = '\0';
@@ -741,17 +749,17 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
- if (abs_dir_cnt + abs_file_cnt != 0)
- {
- size_t len = (abs_dir_cnt + abs_file_cnt) * (base_len - dest_len);
-
- if (len == 1)
- error (EXIT_FAILURE, 0, "-b arg has to be either the same length as -d arg, or more than 1 char shorter");
- memset (ptr, 'X', len - 1);
- ptr += len - 1;
- *ptr++ = '\0';
- }
*ptr++ = '\0';
++srcptr;
@@ -741,21 +736,30 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
elf_flagdata (debug_sections[DEBUG_STR].elf_data,
ELF_C_SET, ELF_F_DIRTY);
}
@ -195,7 +220,20 @@ Index: b/tools/debugedit.c
}
*ptr = '\0';
free (buf);
@@ -767,17 +775,13 @@ edit_attributes (DSO *dso, unsigned char
}
+
+ /* move the line number program */
+ ptr++;
+ if (ptr != endprol)
+ memmove(ptr, endprol, endcu - endprol);
+
+ /* fill the rest of the section with a NOP opcode */
+ ptr += endcu - endprol;
+ memset(ptr, opcode_base - line_base, endcu - ptr);
return 0;
}
@@ -767,17 +771,13 @@ edit_attributes (DSO *dso, unsigned char
int i;
uint_32 list_offs;
int found_list_offs;
@ -215,7 +253,7 @@ Index: b/tools/debugedit.c
while (1)
{
@@ -791,56 +795,55 @@ edit_attributes (DSO *dso, unsigned char
@@ -791,56 +791,55 @@ edit_attributes (DSO *dso, unsigned char
}
if (t->attr[i].attr == DW_AT_comp_dir)
@ -294,7 +332,7 @@ Index: b/tools/debugedit.c
else if ((t->tag == DW_TAG_compile_unit
|| t->tag == DW_TAG_partial_unit)
&& t->attr[i].attr == DW_AT_name
@@ -848,9 +851,9 @@ edit_attributes (DSO *dso, unsigned char
@@ -848,9 +847,9 @@ edit_attributes (DSO *dso, unsigned char
&& debug_sections[DEBUG_STR].data)
{
char *name;
@ -307,7 +345,7 @@ Index: b/tools/debugedit.c
if (*name == '/' && comp_dir == NULL)
{
char *enddir = strrchr (name, '/');
@@ -869,7 +872,7 @@ edit_attributes (DSO *dso, unsigned char
@@ -869,7 +868,7 @@ edit_attributes (DSO *dso, unsigned char
{
base_len = strlen (base_dir);
dest_len = strlen (dest_dir);
@ -316,7 +354,7 @@ Index: b/tools/debugedit.c
memcpy (name, dest_dir, dest_len);
if (dest_len < base_len)
{
@@ -913,7 +916,7 @@ edit_attributes (DSO *dso, unsigned char
@@ -913,7 +912,7 @@ edit_attributes (DSO *dso, unsigned char
ptr += 4;
break;
case DW_FORM_string:

View File

@ -24,7 +24,7 @@ License: GPL v2 or later
Group: System/Packages
Summary: Python Bindings for Manipulating RPM Packages
Version: 4.4.2.3
Release: 8
Release: 9
Requires: rpm = %{version}
%py_requires
Source99: rpm.spec

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Oct 21 11:22:22 CEST 2008 - jblunck@suse.de
- debugedit: Fix debuginfo problems introduced by last patch (bnc #433182)
-------------------------------------------------------------------
Mon Oct 20 16:16:01 CEST 2008 - mls@suse.de
@ -354,7 +359,7 @@ Thu Mar 22 16:41:44 CET 2007 - stbinner@suse.de
- files.diff: when checking %files list also show unpackaged files
after "not found" error message [#255780]
------------------------------------------------------------------
-------------------------------------------------------------------
Thu Mar 22 10:45:08 CET 2007 - dmueller@suse.de
- remove strangely duplicated libpopt
@ -774,8 +779,8 @@ Wed Sep 7 18:13:11 CEST 2005 - matz@suse.de
- Make debuginfo packages require exact version of base rpm.
-------------------------------------------------------------------
-------------------------------------------------------------------
Fri Sep 2 13:07:08 CEST 2005 - mls@suse.de
- backport CLOEXEC workaround [#93727]
@ -2277,7 +2282,7 @@ Mon Feb 22 15:08:09 MET 1999 - ro@suse.de
- update to 2.91
- ported ma's fixes
------------------------------------------------------------------
-------------------------------------------------------------------
Wed Nov 25 19:06:11 MET 1998 - ma@suse.de
- new version 2.5.5
@ -2363,7 +2368,7 @@ Mon Oct 27 15:29:41 MET 1997 - ma@suse.de
- patch: ignore errors when installing a symlink and called from YaST
- de.po update
----------------------------------------------------------------------
-------------------------------------------------------------------
Thu Aug 7 17:46:48 MEST 1997 - ma@suse.de
- duplicate '--nodeps' entry in rpm manpage deleted.
@ -2372,13 +2377,13 @@ Thu Aug 7 17:46:48 MEST 1997 - ma@suse.de
is disabeled, unless environment variable RPM_IgnoreFailedSymlinks
is set.
----------------------------------------------------------------------
-------------------------------------------------------------------
Tue Jul 15 13:24:22 MEST 1997 - ro@suse.de
- added workaround to skip installing a symlink when
impossible to remove an existing directory
----------------------------------------------------------------------
-------------------------------------------------------------------
Thu Jun 26 19:10:48 MEST 1997 - ma@suse.de
- introducing rpm, version 2.4.1

View File

@ -27,7 +27,7 @@ PreReq: %insserv_prereq %fillup_prereq permissions
AutoReqProv: on
Summary: The RPM Package Manager
Version: 4.4.2.3
Release: 8
Release: 9
Source: rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2
@ -323,7 +323,7 @@ Summary: A C library for parsing command line parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 456
Release: 457
#
%description -n popt
@ -346,7 +346,7 @@ Summary: C Library for Parsing Command Line Parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 456
Release: 457
Requires: popt = 1.7
Requires: glibc-devel
@ -381,6 +381,8 @@ Authors:
%doc %{_mandir}/man3/popt.3*
%changelog
* Tue Oct 21 2008 jblunck@suse.de
- debugedit: Fix debuginfo problems introduced by last patch (bnc #433182)
* Mon Oct 20 2008 mls@suse.de
- drop static libraries and libtool archives
* Thu Oct 02 2008 vuntz@suse.de