This commit is contained in:
parent
2028891db1
commit
57a3b24e28
@ -1,10 +1,15 @@
|
|||||||
---
|
Subject: Fix path canonicalization issues in debugedit
|
||||||
tools/debugedit.c | 137 +++++++++++++++++++++++++++---------------------------
|
|
||||||
1 file changed, 70 insertions(+), 67 deletions(-)
|
|
||||||
|
|
||||||
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
|
+++ tools/debugedit.c
|
||||||
@@ -471,13 +471,13 @@ has_prefix (const char *str,
|
@@ -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;
|
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)
|
edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase)
|
||||||
{
|
{
|
||||||
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
|
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
|
||||||
@ -30,8 +35,11 @@ Index: b/tools/debugedit.c
|
|||||||
+ char **dirt;
|
+ char **dirt;
|
||||||
unsigned char *endsec = ptr + debug_sections[DEBUG_LINE].size;
|
unsigned char *endsec = ptr + debug_sections[DEBUG_LINE].size;
|
||||||
unsigned char *endcu, *endprol;
|
unsigned char *endcu, *endprol;
|
||||||
|
+ char line_base;
|
||||||
unsigned char opcode_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)
|
if (phase != 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -43,7 +51,7 @@ Index: b/tools/debugedit.c
|
|||||||
endcu = ptr + 4;
|
endcu = ptr + 4;
|
||||||
endcu += read_32 (ptr);
|
endcu += read_32 (ptr);
|
||||||
if (endcu == ptr + 0xffffffff)
|
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);
|
value);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -52,12 +60,13 @@ Index: b/tools/debugedit.c
|
|||||||
endprol = ptr + 4;
|
endprol = ptr + 4;
|
||||||
endprol += read_32 (ptr);
|
endprol += read_32 (ptr);
|
||||||
if (endprol > endcu)
|
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);
|
dso->filename);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
|
+ line_base = (char) (ptr[2] & 0xff);
|
||||||
opcode_base = ptr[4];
|
opcode_base = ptr[4];
|
||||||
ptr = dir = ptr + 4 + opcode_base;
|
ptr = dir = ptr + 4 + opcode_base;
|
||||||
-
|
-
|
||||||
@ -85,7 +94,7 @@ Index: b/tools/debugedit.c
|
|||||||
}
|
}
|
||||||
ptr++;
|
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;
|
char *s, *file;
|
||||||
size_t file_len, dir_len;
|
size_t file_len, dir_len;
|
||||||
|
|
||||||
@ -96,7 +105,7 @@ Index: b/tools/debugedit.c
|
|||||||
value = read_uleb128 (ptr);
|
value = read_uleb128 (ptr);
|
||||||
|
|
||||||
if (value >= dirt_cnt)
|
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);
|
free (s);
|
||||||
@ -105,7 +114,7 @@ Index: b/tools/debugedit.c
|
|||||||
read_uleb128 (ptr);
|
read_uleb128 (ptr);
|
||||||
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)
|
if (dest_dir)
|
||||||
{
|
{
|
||||||
@ -114,7 +123,7 @@ Index: b/tools/debugedit.c
|
|||||||
size_t base_len = strlen (base_dir);
|
size_t base_len = strlen (base_dir);
|
||||||
size_t dest_len = strlen (dest_dir);
|
size_t dest_len = strlen (dest_dir);
|
||||||
size_t shrank = 0;
|
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;
|
ptr = dir;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -135,7 +144,7 @@ Index: b/tools/debugedit.c
|
|||||||
|
|
||||||
if (*srcptr == '/' && has_prefix (srcptr, base_dir))
|
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);
|
memcpy (ptr, dest_dir, dest_len);
|
||||||
ptr += dest_len;
|
ptr += dest_len;
|
||||||
readptr += base_len;
|
readptr += base_len;
|
||||||
@ -149,9 +158,11 @@ Index: b/tools/debugedit.c
|
|||||||
+ canonicalize_path (readptr, (char *)ptr);
|
+ canonicalize_path (readptr, (char *)ptr);
|
||||||
+ len = strlen ((char *)ptr);
|
+ len = strlen ((char *)ptr);
|
||||||
+
|
+
|
||||||
|
+/*
|
||||||
+ if ((srcptr - readptr) > len)
|
+ if ((srcptr - readptr) > len)
|
||||||
+ error(0, 0,"canonicalization unexpectedly shrank (%lu): \"%s\"\n",
|
+ error(0, 0,"canonicalization unexpectedly shrank (%lu): \"%s\"\n",
|
||||||
+ (long unsigned int)(srcptr - readptr) - len, ptr);
|
+ (long unsigned int)(srcptr - readptr) - len, ptr);
|
||||||
|
+*/
|
||||||
+
|
+
|
||||||
shrank -= len;
|
shrank -= len;
|
||||||
ptr += len;
|
ptr += len;
|
||||||
@ -159,21 +170,35 @@ Index: b/tools/debugedit.c
|
|||||||
- elf_flagdata (debug_sections[DEBUG_STR].elf_data,
|
- elf_flagdata (debug_sections[DEBUG_STR].elf_data,
|
||||||
- ELF_C_SET, ELF_F_DIRTY);
|
- 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_flagdata (debug_sections[DEBUG_STR].elf_data,
|
||||||
+ ELF_C_SET, ELF_F_DIRTY);
|
+ ELF_C_SET, ELF_F_DIRTY);
|
||||||
+ ++ptr;
|
+ ++ptr;
|
||||||
+ ++srcptr;
|
+ ++srcptr;
|
||||||
+ }
|
}
|
||||||
|
|
||||||
if (shrank > 0)
|
- if (abs_dir_cnt + abs_file_cnt != 0)
|
||||||
{
|
- {
|
||||||
- if (--shrank == 0)
|
- size_t len = (abs_dir_cnt + abs_file_cnt) * (base_len - dest_len);
|
||||||
- error (EXIT_FAILURE, 0,
|
-
|
||||||
- "canonicalization unexpectedly shrank by one character");
|
- if (len == 1)
|
||||||
memset (ptr, 'X', shrank);
|
- error (EXIT_FAILURE, 0, "-b arg has to be either the same length as -d arg, or more than 1 char shorter");
|
||||||
ptr += shrank;
|
- memset (ptr, 'X', len - 1);
|
||||||
|
- ptr += len - 1;
|
||||||
|
- *ptr++ = '\0';
|
||||||
|
- }
|
||||||
*ptr++ = '\0';
|
*ptr++ = '\0';
|
||||||
@@ -741,17 +749,17 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
|
++srcptr;
|
||||||
|
|
||||||
|
@@ -741,21 +736,30 @@ edit_dwarf2_line (DSO *dso, uint_32 off,
|
||||||
elf_flagdata (debug_sections[DEBUG_STR].elf_data,
|
elf_flagdata (debug_sections[DEBUG_STR].elf_data,
|
||||||
ELF_C_SET, ELF_F_DIRTY);
|
ELF_C_SET, ELF_F_DIRTY);
|
||||||
}
|
}
|
||||||
@ -195,7 +220,20 @@ Index: b/tools/debugedit.c
|
|||||||
}
|
}
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
free (buf);
|
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;
|
int i;
|
||||||
uint_32 list_offs;
|
uint_32 list_offs;
|
||||||
int found_list_offs;
|
int found_list_offs;
|
||||||
@ -215,7 +253,7 @@ Index: b/tools/debugedit.c
|
|||||||
|
|
||||||
while (1)
|
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)
|
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
|
else if ((t->tag == DW_TAG_compile_unit
|
||||||
|| t->tag == DW_TAG_partial_unit)
|
|| t->tag == DW_TAG_partial_unit)
|
||||||
&& t->attr[i].attr == DW_AT_name
|
&& 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)
|
&& debug_sections[DEBUG_STR].data)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
@ -307,7 +345,7 @@ Index: b/tools/debugedit.c
|
|||||||
if (*name == '/' && comp_dir == NULL)
|
if (*name == '/' && comp_dir == NULL)
|
||||||
{
|
{
|
||||||
char *enddir = strrchr (name, '/');
|
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);
|
base_len = strlen (base_dir);
|
||||||
dest_len = strlen (dest_dir);
|
dest_len = strlen (dest_dir);
|
||||||
@ -316,7 +354,7 @@ Index: b/tools/debugedit.c
|
|||||||
memcpy (name, dest_dir, dest_len);
|
memcpy (name, dest_dir, dest_len);
|
||||||
if (dest_len < base_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;
|
ptr += 4;
|
||||||
break;
|
break;
|
||||||
case DW_FORM_string:
|
case DW_FORM_string:
|
||||||
|
@ -24,7 +24,7 @@ License: GPL v2 or later
|
|||||||
Group: System/Packages
|
Group: System/Packages
|
||||||
Summary: Python Bindings for Manipulating RPM Packages
|
Summary: Python Bindings for Manipulating RPM Packages
|
||||||
Version: 4.4.2.3
|
Version: 4.4.2.3
|
||||||
Release: 8
|
Release: 9
|
||||||
Requires: rpm = %{version}
|
Requires: rpm = %{version}
|
||||||
%py_requires
|
%py_requires
|
||||||
Source99: rpm.spec
|
Source99: rpm.spec
|
||||||
|
17
rpm.changes
17
rpm.changes
@ -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
|
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
|
- files.diff: when checking %files list also show unpackaged files
|
||||||
after "not found" error message [#255780]
|
after "not found" error message [#255780]
|
||||||
|
|
||||||
------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Mar 22 10:45:08 CET 2007 - dmueller@suse.de
|
Thu Mar 22 10:45:08 CET 2007 - dmueller@suse.de
|
||||||
|
|
||||||
- remove strangely duplicated libpopt
|
- 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.
|
- Make debuginfo packages require exact version of base rpm.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
Fri Sep 2 13:07:08 CEST 2005 - mls@suse.de
|
Fri Sep 2 13:07:08 CEST 2005 - mls@suse.de
|
||||||
|
|
||||||
- backport CLOEXEC workaround [#93727]
|
- backport CLOEXEC workaround [#93727]
|
||||||
@ -2277,7 +2282,7 @@ Mon Feb 22 15:08:09 MET 1999 - ro@suse.de
|
|||||||
- update to 2.91
|
- update to 2.91
|
||||||
- ported ma's fixes
|
- ported ma's fixes
|
||||||
|
|
||||||
------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Nov 25 19:06:11 MET 1998 - ma@suse.de
|
Wed Nov 25 19:06:11 MET 1998 - ma@suse.de
|
||||||
|
|
||||||
- new version 2.5.5
|
- 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
|
- patch: ignore errors when installing a symlink and called from YaST
|
||||||
- de.po update
|
- de.po update
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Aug 7 17:46:48 MEST 1997 - ma@suse.de
|
Thu Aug 7 17:46:48 MEST 1997 - ma@suse.de
|
||||||
|
|
||||||
- duplicate '--nodeps' entry in rpm manpage deleted.
|
- 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 disabeled, unless environment variable RPM_IgnoreFailedSymlinks
|
||||||
is set.
|
is set.
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 15 13:24:22 MEST 1997 - ro@suse.de
|
Tue Jul 15 13:24:22 MEST 1997 - ro@suse.de
|
||||||
|
|
||||||
- added workaround to skip installing a symlink when
|
- added workaround to skip installing a symlink when
|
||||||
impossible to remove an existing directory
|
impossible to remove an existing directory
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jun 26 19:10:48 MEST 1997 - ma@suse.de
|
Thu Jun 26 19:10:48 MEST 1997 - ma@suse.de
|
||||||
|
|
||||||
- introducing rpm, version 2.4.1
|
- introducing rpm, version 2.4.1
|
||||||
|
8
rpm.spec
8
rpm.spec
@ -27,7 +27,7 @@ PreReq: %insserv_prereq %fillup_prereq permissions
|
|||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Summary: The RPM Package Manager
|
Summary: The RPM Package Manager
|
||||||
Version: 4.4.2.3
|
Version: 4.4.2.3
|
||||||
Release: 8
|
Release: 9
|
||||||
Source: rpm-%{version}.tar.bz2
|
Source: rpm-%{version}.tar.bz2
|
||||||
Source1: RPM-HOWTO.tar.bz2
|
Source1: RPM-HOWTO.tar.bz2
|
||||||
Source2: RPM-Tips.html.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
|
License: LGPL v2.1 or later
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Version: 1.7
|
Version: 1.7
|
||||||
Release: 456
|
Release: 457
|
||||||
#
|
#
|
||||||
|
|
||||||
%description -n popt
|
%description -n popt
|
||||||
@ -346,7 +346,7 @@ Summary: C Library for Parsing Command Line Parameters
|
|||||||
License: LGPL v2.1 or later
|
License: LGPL v2.1 or later
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Version: 1.7
|
Version: 1.7
|
||||||
Release: 456
|
Release: 457
|
||||||
Requires: popt = 1.7
|
Requires: popt = 1.7
|
||||||
Requires: glibc-devel
|
Requires: glibc-devel
|
||||||
|
|
||||||
@ -381,6 +381,8 @@ Authors:
|
|||||||
%doc %{_mandir}/man3/popt.3*
|
%doc %{_mandir}/man3/popt.3*
|
||||||
|
|
||||||
%changelog
|
%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
|
* Mon Oct 20 2008 mls@suse.de
|
||||||
- drop static libraries and libtool archives
|
- drop static libraries and libtool archives
|
||||||
* Thu Oct 02 2008 vuntz@suse.de
|
* Thu Oct 02 2008 vuntz@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user