SHA256
1
0
forked from pool/dwz
dwz/dwz-0.12-ignore-nobits.patch
Richard Biener e7246eb48a Accepting request 460022 from home:rguenther:hw15
- Add dwz-0.12-ignore-nobits.patch to ignore SHT_NOBITS sections
  that are placed out-of-order by objcopy when extracting debuginfo
  and place them at sh_offset zero.

OBS-URL: https://build.opensuse.org/request/show/460022
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/dwz?expand=0&rev=5
2017-02-23 12:22:03 +00:00

19 lines
631 B
Diff

diff --git a/dwz.c b/dwz.c
index b3b779d..074ac19 100644
--- a/dwz.c
+++ b/dwz.c
@@ -10141,6 +10141,13 @@ write_dso (DSO *dso, const char *file, struct stat *st)
for (j = 1; j < dso->ehdr.e_shnum; ++j)
if (dso->shdr[j].sh_offset < min_shoff && !last_shoff)
continue;
+ else if (dso->shdr[j].sh_type == SHT_NOBITS)
+ {
+ /* Fixup NOBITS placement which if initially out-of-order
+ can be nonsensically now. */
+ dso->shdr[j].sh_offset = 0;
+ continue;
+ }
else if ((dso->shdr[j].sh_flags & SHF_ALLOC) != 0)
{
error (0, 0, "Allocatable section in %s after non-allocatable "