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
This commit is contained in:
Richard Biener 2017-02-23 12:22:03 +00:00 committed by Git OBS Bridge
parent 6838c3e4b7
commit e7246eb48a
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 Tue Nov 29 08:51:04 UTC 2016 - rguenther@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package dwz # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: dwz Name: dwz
Version: 0.12 Version: 0.12
Release: 1 Release: 0
Summary: DWARF optimization and duplicate removal tool Summary: DWARF optimization and duplicate removal tool
License: GPL-2.0+ and LGPL-2.0+ License: GPL-2.0+ and LGPL-2.0+
Group: Development/Tools/Building Group: Development/Tools/Building
@ -22,6 +26,7 @@ Group: Development/Tools/Building
#Git-Clone: git://sourceware.org/git/dwz #Git-Clone: git://sourceware.org/git/dwz
#Git-Web: https://sourceware.org/git/?p=dwz.git;a=summary #Git-Web: https://sourceware.org/git/?p=dwz.git;a=summary
Source: %name-%version.tar.xz Source: %name-%version.tar.xz
Patch: dwz-0.12-ignore-nobits.patch
BuildRequires: libelf-devel BuildRequires: libelf-devel
BuildRequires: xz BuildRequires: xz
@ -45,6 +50,7 @@ is needed.
%prep %prep
%setup -qn %name %setup -qn %name
%patch -p1
%build %build
make %{?_smp_mflags} CFLAGS="%optflags" make %{?_smp_mflags} CFLAGS="%optflags"