From e7246eb48a2144c7eb614b41603c4d8e2d1191ba64e22696f67dcbd9da3bf082 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 23 Feb 2017 12:22:03 +0000 Subject: [PATCH] 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 --- dwz-0.12-ignore-nobits.patch | 18 ++++++++++++++++++ dwz.changes | 7 +++++++ dwz.spec | 10 ++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 dwz-0.12-ignore-nobits.patch diff --git a/dwz-0.12-ignore-nobits.patch b/dwz-0.12-ignore-nobits.patch new file mode 100644 index 0000000..4ad49c5 --- /dev/null +++ b/dwz-0.12-ignore-nobits.patch @@ -0,0 +1,18 @@ +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 " diff --git a/dwz.changes b/dwz.changes index b00caaf..0126e5b 100644 --- a/dwz.changes +++ b/dwz.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Feb 21 13:35:26 UTC 2017 - rguenther@suse.com + +- 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. + ------------------------------------------------------------------- Tue Nov 29 08:51:04 UTC 2016 - rguenther@suse.com diff --git a/dwz.spec b/dwz.spec index 03d7a97..86b6fbe 100644 --- a/dwz.spec +++ b/dwz.spec @@ -1,7 +1,7 @@ # # spec file for package dwz # -# Copyright (c) 2012 openSUSE +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,9 +12,13 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + Name: dwz Version: 0.12 -Release: 1 +Release: 0 Summary: DWARF optimization and duplicate removal tool License: GPL-2.0+ and LGPL-2.0+ Group: Development/Tools/Building @@ -22,6 +26,7 @@ Group: Development/Tools/Building #Git-Clone: git://sourceware.org/git/dwz #Git-Web: https://sourceware.org/git/?p=dwz.git;a=summary Source: %name-%version.tar.xz +Patch: dwz-0.12-ignore-nobits.patch BuildRequires: libelf-devel BuildRequires: xz @@ -45,6 +50,7 @@ is needed. %prep %setup -qn %name +%patch -p1 %build make %{?_smp_mflags} CFLAGS="%optflags"