diff -Nru dwz-0.11/debian/changelog dwz-0.12/debian/changelog --- dwz-0.11/debian/changelog 2014-03-27 10:02:16.000000000 +0000 +++ dwz-0.12/debian/changelog 2019-06-30 11:35:59.000000000 +0000 @@ -1,3 +1,29 @@ +dwz (0.12-3~14.04) trusty; urgency=medium + + * PPA upload. + + -- Matthias Klose Sun, 30 Jun 2019 13:31:41 +0200 + +dwz (0.12-3) unstable; urgency=medium + + * Add DW_OP_GNU_variable_value support (taken from the trunk). + * Bump standards version. + + -- Matthias Klose Tue, 11 Dec 2018 12:06:52 +0100 + +dwz (0.12-2) unstable; urgency=medium + + * Make the package M-A: foreign. + * Bump standards version. + + -- Matthias Klose Wed, 25 Oct 2017 09:33:11 +0200 + +dwz (0.12-1) unstable; urgency=medium + + * New upstream version. + + -- Matthias Klose Mon, 15 Feb 2016 20:06:32 +0100 + dwz (0.11-1) unstable; urgency=medium * New upstream version. diff -Nru dwz-0.11/debian/compat dwz-0.12/debian/compat --- dwz-0.11/debian/compat 2012-06-25 09:44:56.000000000 +0000 +++ dwz-0.12/debian/compat 2016-02-15 19:07:08.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru dwz-0.11/debian/control dwz-0.12/debian/control --- dwz-0.11/debian/control 2014-03-27 10:03:18.000000000 +0000 +++ dwz-0.12/debian/control 2018-12-11 11:06:52.000000000 +0000 @@ -1,14 +1,15 @@ Source: dwz Section: devel -Priority: extra +Priority: optional Maintainer: Debian GCC Maintainers Uploaders: Matthias Klose -Build-Depends: debhelper (>= 8.0.0), libelf-dev -Standards-Version: 3.9.5 +Build-Depends: debhelper (>= 9), libelf-dev +Standards-Version: 4.1.2 Homepage: http://sourceware.org/git/?p=dwz.git;a=summary Package: dwz Architecture: any +Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends} Description: DWARF compression tool DWARF optimizer and duplication removal utility. diff -Nru dwz-0.11/debian/patches/2124f9b50c2c4963e1ac6f1716ca48b114643ca8.diff dwz-0.12/debian/patches/2124f9b50c2c4963e1ac6f1716ca48b114643ca8.diff --- dwz-0.11/debian/patches/2124f9b50c2c4963e1ac6f1716ca48b114643ca8.diff 1970-01-01 00:00:00.000000000 +0000 +++ dwz-0.12/debian/patches/2124f9b50c2c4963e1ac6f1716ca48b114643ca8.diff 2018-12-11 11:06:52.000000000 +0000 @@ -0,0 +1,58 @@ +From 2124f9b50c2c4963e1ac6f1716ca48b114643ca8 Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek +Date: Wed, 11 Apr 2018 14:25:06 +0200 +Subject: [PATCH] Add DW_OP_GNU_variable_value support. + +--- + dwarf2.def | 3 +++ + dwz.c | 6 ++++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dwarf2.def b/dwarf2.def +index e9a8bca..17311fa 100644 +--- a/dwarf2.def ++++ b/dwarf2.def +@@ -588,6 +588,9 @@ DW_OP (DW_OP_GNU_reinterpret, 0xf9) + DW_OP (DW_OP_GNU_parameter_ref, 0xfa) + /* Extension for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ + DW_OP (DW_OP_GNU_addr_index, 0xfb) ++/* The GNU variable value extension. ++ See http://dwarfstd.org/ShowIssue.php?issue=161109.2 . */ ++DW_OP (DW_OP_GNU_variable_value, 0xfd) + /* HP extensions. */ + DW_OP_DUP (DW_OP_HP_unknown, 0xe0) /* Ouch, the same as GNU_push_tls_address. */ + DW_OP (DW_OP_HP_is_value, 0xe1) +diff --git a/dwz.c b/dwz.c +index b3b779d..d348418 100644 +--- a/dwz.c ++++ b/dwz.c +@@ -1523,6 +1523,7 @@ read_exprloc (DSO *dso, dw_die_ref die, unsigned char *ptr, size_t len, + break; + case DW_OP_call_ref: + case DW_OP_GNU_implicit_pointer: ++ case DW_OP_GNU_variable_value: + cu = die_cu (die); + addr = read_size (ptr, cu->cu_version == 2 ? ptr_size : 4); + if (cu->cu_version == 2) +@@ -7823,8 +7824,8 @@ init_new_die_offsets (dw_die_ref die, unsigned int off, + default: + break; + } +- die->die_size += die->u.p2.die_intracu_udata_size; +- } ++ die->die_size += die->u.p2.die_intracu_udata_size; ++ } + off += die->die_size; + for (child = die->die_child; child; child = child->die_sib) + off = init_new_die_offsets (child, off, intracusize); +@@ -8577,6 +8578,7 @@ adjust_exprloc (dw_cu_ref cu, dw_die_ref die, dw_cu_ref refcu, + break; + case DW_OP_call_ref: + case DW_OP_GNU_implicit_pointer: ++ case DW_OP_GNU_variable_value: + addr = read_size (ptr, refcu->cu_version == 2 ? ptr_size : 4); + assert (cu->cu_version == refcu->cu_version); + refd = off_htab_lookup (NULL, addr); +-- +2.9.3 + diff -Nru dwz-0.11/debian/patches/series dwz-0.12/debian/patches/series --- dwz-0.11/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ dwz-0.12/debian/patches/series 2018-12-11 11:06:52.000000000 +0000 @@ -0,0 +1 @@ +2124f9b50c2c4963e1ac6f1716ca48b114643ca8.diff diff -Nru dwz-0.11/debian/rules dwz-0.12/debian/rules --- dwz-0.11/debian/rules 2013-01-27 20:47:45.000000000 +0000 +++ dwz-0.12/debian/rules 2016-02-15 19:09:07.000000000 +0000 @@ -8,7 +8,7 @@ LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) %: - dh $@ + dh $@ --parallel override_dh_auto_build: dh_auto_build -- CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" diff -Nru dwz-0.11/dwz.c dwz-0.12/dwz.c --- dwz-0.11/dwz.c 2014-03-27 10:00:58.000000000 +0000 +++ dwz-0.12/dwz.c 2016-02-15 19:05:33.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2012 Red Hat, Inc. +/* Copyright (C) 2001-2015 Red Hat, Inc. Copyright (C) 2003 Free Software Foundation, Inc. Written by Jakub Jelinek , 2012. @@ -10023,9 +10023,10 @@ { Elf *elf = NULL; GElf_Ehdr ehdr; + GElf_Off min_shoff = ~(GElf_Off) 0; char *e_ident; int fd, i, j, addsec = -1, ret; - GElf_Off off, diff; + GElf_Off off, diff, addsize = 0; char *filename = NULL; GElf_Word shstrtabadd = 0; char *shstrtab = NULL; @@ -10050,6 +10051,8 @@ && debug_sections[j].sec > addsec) addsec = debug_sections[j].sec; ehdr.e_shnum++; + if (ehdr.e_shoff < min_shoff) + min_shoff = ehdr.e_shoff; for (j = 1; j < dso->ehdr.e_shnum; ++j) { if (dso->shdr[j].sh_offset > ehdr.e_shoff) @@ -10067,12 +10070,15 @@ ehdr.e_shstrndx++; len = strlen (debug_sections[i].name) + 1; dso->shdr[dso->ehdr.e_shstrndx].sh_size += len; + if (dso->shdr[dso->ehdr.e_shstrndx].sh_offset < min_shoff) + min_shoff = dso->shdr[dso->ehdr.e_shstrndx].sh_offset; for (j = dso->ehdr.e_shstrndx + 1; j < dso->ehdr.e_shnum; ++j) dso->shdr[j].sh_offset += len; if (ehdr.e_shoff > dso->shdr[dso->ehdr.e_shstrndx].sh_offset) ehdr.e_shoff += len; shstrtabadd += len; diff = debug_sections[i].new_size; + addsize += diff; off = dso->shdr[addsec].sh_offset; } else @@ -10081,6 +10087,8 @@ - (GElf_Off) dso->shdr[debug_sections[i].sec].sh_size; off = dso->shdr[debug_sections[i].sec].sh_offset; } + if (off < min_shoff) + min_shoff = off; for (j = 1; j < dso->ehdr.e_shnum; ++j) if (dso->shdr[j].sh_offset > off) dso->shdr[j].sh_offset += diff; @@ -10092,6 +10100,8 @@ { remove_sections[i] = true; ehdr.e_shnum--; + if (ehdr.e_shoff < min_shoff) + min_shoff = ehdr.e_shoff; for (j = 1; j < dso->ehdr.e_shnum; ++j) { if (dso->shdr[j].sh_offset > ehdr.e_shoff) @@ -10111,6 +10121,73 @@ } } + if (min_shoff != ~(GElf_Off) 0) + { + for (j = 1; j < dso->ehdr.e_shnum; ++j) + if (dso->shdr[j].sh_offset >= min_shoff + && dso->shdr[j].sh_addralign > 1 + && (dso->shdr[j].sh_offset & (dso->shdr[j].sh_addralign - 1)) != 0) + break; + if (j < dso->ehdr.e_shnum + || (ehdr.e_shoff >= min_shoff + && (ehdr.e_shoff & (ehdr.e_ident[EI_CLASS] == ELFCLASS64 + ? 7 : 3)) != 0)) + { + /* Need to fix up sh_offset/e_shoff. Punt if all the sections + >= min_shoff aren't non-ALLOC. */ + GElf_Off last_shoff = 0; + int k = -1; + bool shdr_placed = false; + 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_flags & SHF_ALLOC) != 0) + { + error (0, 0, "Allocatable section in %s after non-allocatable " + "ones", dso->filename); + return 1; + } + else if (dso->shdr[j].sh_offset < last_shoff) + { + error (0, 0, "Section offsets in %s not monotonically " + "increasing", dso->filename); + return 1; + } + else + { + if (k == -1) + k = j; + last_shoff = dso->shdr[j].sh_offset + dso->shdr[j].sh_size; + } + last_shoff = min_shoff; + for (j = k; j <= dso->ehdr.e_shnum; ++j) + { + if (!shdr_placed + && ehdr.e_shoff >= min_shoff + && (j == dso->ehdr.e_shnum + || ehdr.e_shoff < dso->shdr[j].sh_offset)) + { + if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) + ehdr.e_shoff = (last_shoff + 7) & -8; + else + ehdr.e_shoff = (last_shoff + 3) & -4; + last_shoff = ehdr.e_shoff + ehdr.e_shnum * ehdr.e_shentsize; + shdr_placed = true; + } + if (j == dso->ehdr.e_shnum) + break; + dso->shdr[j].sh_offset = last_shoff; + if (dso->shdr[j].sh_addralign > 1) + dso->shdr[j].sh_offset + = (last_shoff + dso->shdr[j].sh_addralign - 1) + & ~(dso->shdr[j].sh_addralign - (GElf_Off) 1); + last_shoff = dso->shdr[j].sh_offset + dso->shdr[j].sh_size; + if (addsec != -1 && j == addsec) + last_shoff += addsize; + } + } + } + if (shstrtabadd != 0) { shstrtab = (char *) malloc (dso->shdr[dso->ehdr.e_shstrndx].sh_size); @@ -11163,8 +11240,10 @@ { DSO dsobuf, *dso; int fd = -1; + volatile int vfd = -1; unsigned int i; Elf *elf = NULL; + Elf *volatile velf = NULL; GElf_Shdr shdr; Elf_Scn *scn; Elf_Data *data; @@ -11220,12 +11299,12 @@ error (0, 0, "Error mmapping multi-file temporary files"); fail: cleanup (); - if (elf) - elf_end (elf); - if (fd != -1) + if (velf) + elf_end (velf); + if (vfd != -1) { unlink (multifile); - close (fd); + close (vfd); } if (debug_sections[DEBUG_INFO].data != MAP_FAILED) munmap (debug_sections[DEBUG_INFO].data, @@ -11350,6 +11429,7 @@ cleanup (); fd = open (multifile, O_RDWR | O_CREAT, 0600); + vfd = fd; if (fd < 0) { error (0, errno, "Failed to open multi-file common file %s", multifile); @@ -11357,6 +11437,7 @@ } elf = elf_begin (fd, ELF_C_WRITE, NULL); + velf = elf; if (elf == NULL) { error (0, 0, "cannot open ELF file: %s", elf_errmsg (-1)); @@ -11384,9 +11465,11 @@ { case ELFCLASS32: e_ident = (char *) elf32_newehdr (elf); + multi_ehdr.e_shoff = (multi_ehdr.e_shoff + 3) & -4; break; case ELFCLASS64: e_ident = (char *) elf64_newehdr (elf); + multi_ehdr.e_shoff = (multi_ehdr.e_shoff + 7) & -8; break; default: e_ident = NULL; diff -Nru dwz-0.11/VERSION dwz-0.12/VERSION --- dwz-0.11/VERSION 2014-03-27 10:00:58.000000000 +0000 +++ dwz-0.12/VERSION 2016-02-15 19:05:33.000000000 +0000 @@ -1 +1 @@ -0.11 +0.12