Lines 1-5
Link Here
|
1 |
--- dwz.c.orig 2019-10-02 10:26:03.015230341 -0400 |
1 |
--- dwz.c.orig 2021-03-09 22:33:26 UTC |
2 |
+++ dwz.c 2020-04-05 14:12:16.054408000 -0400 |
2 |
+++ dwz.c |
3 |
@@ -20,11 +20,11 @@ |
3 |
@@ -20,11 +20,11 @@ |
4 |
|
4 |
|
5 |
#include <assert.h> |
5 |
#include <assert.h> |
Lines 13-21
Link Here
|
13 |
#include <stdbool.h> |
13 |
#include <stdbool.h> |
14 |
#include <stddef.h> |
14 |
#include <stddef.h> |
15 |
#include <stdint.h> |
15 |
#include <stdint.h> |
16 |
@@ -34,7 +34,7 @@ |
16 |
@@ -36,7 +36,7 @@ |
17 |
#include <sys/stat.h> |
|
|
18 |
#include <sys/types.h> |
17 |
#include <sys/types.h> |
|
|
18 |
#include <sys/times.h> |
19 |
|
19 |
|
20 |
-#include <obstack.h> |
20 |
-#include <obstack.h> |
21 |
+#include "obstack.h" |
21 |
+#include "obstack.h" |
Lines 22-30
Link Here
|
22 |
|
22 |
|
23 |
#include <gelf.h> |
23 |
#include <gelf.h> |
24 |
#include "dwarf2.h" |
24 |
#include "dwarf2.h" |
25 |
@@ -136,6 +136,29 @@ dwz_oom (void) |
25 |
@@ -165,6 +165,29 @@ report_progress (void) |
26 |
longjmp (oom_buf, 1); |
26 |
/* Where to longjmp on OOM. */ |
27 |
} |
27 |
static jmp_buf oom_buf; |
28 |
|
28 |
|
29 |
+/* error () wrapper based on the Linux manual page at |
29 |
+/* error () wrapper based on the Linux manual page at |
30 |
+ http://man7.org/linux/man-pages/man3/error.3.html. */ |
30 |
+ http://man7.org/linux/man-pages/man3/error.3.html. */ |
Lines 49-58
Link Here
|
49 |
+ exit (status); |
49 |
+ exit (status); |
50 |
+} |
50 |
+} |
51 |
+ |
51 |
+ |
52 |
/* General obstack for struct dw_cu, dw_die, also used for temporary |
52 |
/* Handle OOM situation. If handling more than one file, we might |
53 |
vectors. */ |
53 |
just fail to handle some large file due to OOM, but could very well |
54 |
static struct obstack ob; |
54 |
handle other smaller files after it. */ |
55 |
@@ -10300,7 +10323,7 @@ fdopen_dso (int fd, const char *name) |
55 |
@@ -13723,7 +13746,7 @@ fdopen_dso (int fd, const char *name) |
56 |
int i; |
56 |
int i; |
57 |
DSO *dso = NULL; |
57 |
DSO *dso = NULL; |
58 |
|
58 |
|
Lines 61-67
Link Here
|
61 |
if (elf == NULL) |
61 |
if (elf == NULL) |
62 |
{ |
62 |
{ |
63 |
error (0, 0, "cannot open ELF file: %s", elf_errmsg (-1)); |
63 |
error (0, 0, "cannot open ELF file: %s", elf_errmsg (-1)); |
64 |
@@ -10338,7 +10361,7 @@ fdopen_dso (int fd, const char *name) |
64 |
@@ -13761,7 +13784,7 @@ fdopen_dso (int fd, const char *name) |
65 |
goto error_out; |
65 |
goto error_out; |
66 |
} |
66 |
} |
67 |
|
67 |
|
Lines 70-76
Link Here
|
70 |
|
70 |
|
71 |
memset (dso, 0, sizeof(DSO)); |
71 |
memset (dso, 0, sizeof(DSO)); |
72 |
dso->elf = elf; |
72 |
dso->elf = elf; |
73 |
@@ -10829,7 +10852,7 @@ write_dso (DSO *dso, const char *file, struct stat *st |
73 |
@@ -14258,7 +14281,7 @@ write_dso (DSO *dso, const char *file, struct stat *st |
74 |
free (shstrtab); |
74 |
free (shstrtab); |
75 |
return 1; |
75 |
return 1; |
76 |
} |
76 |
} |
Lines 79-85
Link Here
|
79 |
for (i = 0; i < ehdr.e_phnum; ++i) |
79 |
for (i = 0; i < ehdr.e_phnum; ++i) |
80 |
{ |
80 |
{ |
81 |
GElf_Phdr *phdr, phdr_mem; |
81 |
GElf_Phdr *phdr, phdr_mem; |
82 |
@@ -10902,7 +10925,7 @@ write_dso (DSO *dso, const char *file, struct stat *st |
82 |
@@ -14331,7 +14354,7 @@ write_dso (DSO *dso, const char *file, struct stat *st |
83 |
} |
83 |
} |
84 |
} |
84 |
} |
85 |
|
85 |
|
Lines 88-94
Link Here
|
88 |
{ |
88 |
{ |
89 |
error (0, 0, "%s: elf_update failed", dso->filename); |
89 |
error (0, 0, "%s: elf_update failed", dso->filename); |
90 |
unlink (file); |
90 |
unlink (file); |
91 |
@@ -12089,7 +12112,7 @@ optimize_multifile (void) |
91 |
@@ -15917,7 +15940,7 @@ optimize_multifile (unsigned int *die_count) |
92 |
error (0, 0, "Could not create new ELF headers"); |
92 |
error (0, 0, "Could not create new ELF headers"); |
93 |
goto fail; |
93 |
goto fail; |
94 |
} |
94 |
} |
Lines 97-103
Link Here
|
97 |
|
97 |
|
98 |
sha1_init_ctx (&ctx); |
98 |
sha1_init_ctx (&ctx); |
99 |
for (i = 0; debug_sections[i].name; i++) |
99 |
for (i = 0; debug_sections[i].name; i++) |
100 |
@@ -12176,7 +12199,7 @@ optimize_multifile (void) |
100 |
@@ -16010,7 +16033,7 @@ optimize_multifile (unsigned int *die_count) |
101 |
data->d_off = 0; |
101 |
data->d_off = 0; |
102 |
data->d_align = 1; |
102 |
data->d_align = 1; |
103 |
|
103 |
|