Accepting request 460704 from home:rguenther:branches:Base:System

- Fix debugedit-canon-fix.diff to handle directory table size shrinking
  by 1 byte correctly.

OBS-URL: https://build.opensuse.org/request/show/460704
OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=381
This commit is contained in:
Dirk Mueller 2017-03-01 11:09:17 +00:00 committed by Git OBS Bridge
parent b0a565dbe4
commit 7a839c1a47
2 changed files with 25 additions and 10 deletions

View File

@ -1,5 +1,7 @@
--- ./tools/debugedit.c.orig 2017-01-19 12:59:37.848194305 +0000
+++ ./tools/debugedit.c 2017-01-19 12:59:45.236173176 +0000
Index: tools/debugedit.c
===================================================================
--- tools/debugedit.c.orig 2017-02-27 13:35:18.727800856 +0100
+++ tools/debugedit.c 2017-02-27 14:22:33.975985617 +0100
@@ -162,7 +162,7 @@ strptr (DSO *dso, int sec, off_t offset)
{
if (data->d_buf
@ -71,22 +73,29 @@
char *orig = strdup ((const char *) srcptr);
@@ -730,10 +735,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
@@ -730,11 +735,18 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (shrank > 0)
{
- if (--shrank == 0)
+ --shrank;
+#if 0
+ if (shrank == 0)
error (EXIT_FAILURE, 0,
"canonicalization unexpectedly shrank by one character");
- error (EXIT_FAILURE, 0,
- "canonicalization unexpectedly shrank by one character");
+ if (shrank == 1)
+ {
+ /* For size 1 we can't append a dummy entry as a '\0' tells
+ it the directory table ends prematurely and thus the file
+ table will end up empty. Simply append a / to the last
+ directory entry in this case. */
+ *(ptr - 1) = '/';
+ *ptr++ = '\0';
+ }
else
+#endif
{
+ --shrank;
memset (ptr, 'X', shrank);
ptr += shrank;
@@ -769,21 +777,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
*ptr++ = '\0';
@@ -769,21 +781,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
dirty_section (DEBUG_STR);
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 27 13:24:26 UTC 2017 - rguenther@suse.com
- Fix debugedit-canon-fix.diff to handle directory table size shrinking
by 1 byte correctly.
-------------------------------------------------------------------
Mon Feb 20 14:17:26 CET 2017 - mls@suse.de