Accepting request 460023 from devel:tools:compiler

- 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. (forwarded request 460022 from rguenther)

OBS-URL: https://build.opensuse.org/request/show/460023
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dwz?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2017-03-02 18:28:48 +00:00 committed by Git OBS Bridge
commit 2e9e248463
3 changed files with 33 additions and 2 deletions

View File

@ -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 "

View File

@ -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

View File

@ -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"