Projects
openEuler:Mainline
dwz
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:dwz.spec
Changed
@@ -1,13 +1,12 @@ Name: dwz -Version: 0.14 -Release: 3 +Version: 0.15 +Release: 1 Summary: A DWARF optimization and duplicate removal tool License: GPLv2+ and GPLv3+ URL: https://sourceware.org/dwz/ Source0:https://sourceware.org/ftp/dwz/releases/%{name}-%{version}.tar.xz BuildRequires:gcc gcc-c++ gdb elfutils-libelf-devel dejagnu - -Patch1: testsuite-Handle-readelf-following-links-by-default.patch +BuildRequires:xxhash-devel %description The package contains a program that attempts to optimize DWARF debugging @@ -53,6 +52,15 @@ %{_mandir}/man1/dwz* %changelog +* Thu Jan 19 2023 renhongxun <renhongxun@h-partner.com> - 0.15-1 +- upgrade version to 0.15 + +* Tue Jan 10 2023 dongyuzhen <dongyuzhen@h-partners.com> - 0.14-5 +- fix the testcase fail + +* Tue Oct 25 2022 yanglongkang <yanglongkang@h-partners.com> - 0.14-4 +- rebuild for next release + * Tue Jan 25 2022 renhongxun <renhongxun@h-partner.com> - 0.14-3 - fix testsuite with community patch
View file
_service:tar_scm:backport-Redirect-stder-in-gdb-add-index.sh-test.patch
Added
@@ -0,0 +1,31 @@ +From d03a041790e1d0ecb900ec1de57580bca9519daa Mon Sep 17 00:00:00 2001 +From: Mark Wielaard <mark@klomp.org> +Date: Sat, 2 Jul 2022 01:11:00 +0200 +Subject: PATCH Redirect stder in gdb-add-index.sh test + +gdb-add-index might produce an error message on stderr when trying to +disable debuginfod support. Any message to stderr makes the testcase +fail. This looks like a gdb bug: +https://sourceware.org/bugzilla/show_bug.cgi?id=29316 +But it is easy to workaround by redirecting stderr to stdout. +--- + testsuite/dwz.tests/gdb-add-index.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/testsuite/dwz.tests/gdb-add-index.sh b/testsuite/dwz.tests/gdb-add-index.sh +index 5a91b23..3095efb 100644 +--- a/testsuite/dwz.tests/gdb-add-index.sh ++++ b/testsuite/dwz.tests/gdb-add-index.sh +@@ -1,6 +1,8 @@ + cp $execs/hello 1 + +-gdb-add-index 1 ++# Redirect gdb-add-index stderr to stdout. ++# https://sourceware.org/bugzilla/show_bug.cgi?id=29316 ++gdb-add-index 1 2>&1 + + readelf -S 1 | grep -q '\.gdb_index' + +-- +2.31.1 +
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/dwz.git</param> - <param name="revision">d5dee00a14707d25d7b3ec3051c2bf4fd8849553</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:dwz-0.14.tar.xz/.gitignore -> _service:tar_scm:dwz-0.15.tar.xz/.gitignore
Changed
@@ -4,4 +4,5 @@ dwz dwz.sum dwz.log +native.c testsuite/dwz.tests/execs
View file
_service:tar_scm:dwz-0.14.tar.xz/Makefile -> _service:tar_scm:dwz-0.15.tar.xz/Makefile
Changed
@@ -3,25 +3,60 @@ else srcdir=$(shell pwd) endif + CFLAGS = -O2 -g DWZ_VERSION := $(shell cat $(srcdir)/VERSION) -override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 \ - -DDWZ_VERSION='"$(DWZ_VERSION)"' $(shell cat $(srcdir)/COPYRIGHT_YEARS) +CFLAGS_VERSION = -DDWZ_VERSION='"$(DWZ_VERSION)"' +CFLAGS_COPYRIGHT = $(shell cat $(srcdir)/COPYRIGHT_YEARS) +CFLAGS_COMMON = -Wall -W -D_FILE_OFFSET_BITS=64 +XXH_PROG = "\#define XXH_INLINE_ALL 1\n\#include <xxhash.h>\n" +XXH_INLINE_ALL_WORKS = $(shell printf $(XXH_PROG) \ + | $(CC) -xc -c - -o /dev/null 2>/dev/null \ + && echo -n 1) +ifeq "$(XXH_INLINE_ALL_WORKS)" "1" + CFLAGS_COMMON += -DXXH_INLINE_ALL=1 +endif + +override CFLAGS += $(CFLAGS_COMMON) $(CFLAGS_VERSION) $(CFLAGS_COPYRIGHT) + prefix = /usr exec_prefix = $(prefix) bindir = $(exec_prefix)/bin datarootdir = $(prefix)/share mandir = $(datarootdir)/man -OBJECTS = dwz.o hashtab.o sha1.o dwarfnames.o +OBJECTS = args.o dwz.o hashtab.o pool.o sha1.o dwarfnames.o +LIBS=-lelf +ifneq "$(XXH_INLINE_ALL_WORKS)" "1" +LIBS += -lxxhash +endif dwz: $(OBJECTS) - $(CC) $(LDFLAGS) -o $@ $^ -lelf + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) +args.o: native.o +args.o: CFLAGS_FOR_SOURCE = \ + -DNATIVE_ENDIAN_VAL=$(NATIVE_ENDIAN_VAL) \ + -DNATIVE_POINTER_SIZE=$(NATIVE_POINTER_SIZE) +NATIVE_ENDIAN=$(shell readelf -h native.o \ + | grep Data \ + | sed 's/.*, //;s/ endian//') +NATIVE_ENDIAN_LITTLE=$(findstring $(NATIVE_ENDIAN),$(findstring little,$(NATIVE_ENDIAN))) +NATIVE_ENDIAN_BIG=$(findstring $(NATIVE_ENDIAN),$(findstring big,$(NATIVE_ENDIAN))) +NATIVE_ENDIAN_VAL=$(if $(NATIVE_ENDIAN_LITTLE),ELFDATA2LSB,$(if $(NATIVE_ENDIAN_BIG),ELFDATA2MSB,ELFDATANONE)) +NATIVE_POINTER_SIZE=$(shell readelf -wi native.o \ + | grep "Pointer Size:" \ + | sed 's/.*: *//') +%.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< $(CFLAGS_FOR_SOURCE) install: dwz install -D dwz $(DESTDIR)$(bindir)/dwz install -D -m 644 $(srcdir)/dwz.1 $(DESTDIR)$(mandir)/man1/dwz.1 clean: - rm -f $(OBJECTS) *~ core* dwz $(TEST_EXECS) $(DWZ_TEST_SOURCES) \ - dwz.log dwz.sum + rm -f $(OBJECTS) *~ core* dwz $(TEST_EXECS) $(DWZ_TEST_OBJECTS) \ + dwz.log dwz.sum native.c native.o rm -Rf testsuite-bin tmp.* +native.c: + echo "int main (void) { return 0; }" > $@ +native.o: native.c + $(CC) -o $@ $< -c -g PWD:=$(shell pwd -P) @@ -33,7 +68,7 @@ TEST_EXECS = hello dwz-for-test min two-typedef start hello-gold-gdb-index \ start-gold hello-gnu-pubnames $(TEST_EXECS_DWARF_ASM) \ $(TEST_EXECS_$(UNAME)) odr-struct odr-class odr-union odr-struct-ns \ - odr-class-ns odr-union-ns odr-loc def-decl + odr-class-ns odr-union-ns odr-loc def-decl cycle UNAME:=$(shell uname -p) @@ -50,15 +85,21 @@ py-section-script: $(CC) $(TEST_SRC)/py-section-script.s -o $@ -g || touch $@ -DWZ_TEST_SOURCES := $(patsubst %.o,%-for-test.c,$(OBJECTS)) - -%-for-test.c: %.c - sed 's/__GNUC__/NOT_DEFINED/' $< > $@ - -dwz-for-test: $(DWZ_TEST_SOURCES) - $(CC) $(DWZ_TEST_SOURCES) -O2 -g -lelf -o $@ -Wall -W -DDEVEL \ - -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"for-test"' -I$(srcdir) \ - $(shell cat $(srcdir)/COPYRIGHT_YEARS) +DWZ_TEST_OBJECTS := $(patsubst %.o,%-for-test.o,$(OBJECTS)) +dwz-for-test: $(DWZ_TEST_OBJECTS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + rm -f $(DWZ_TEST_OBJECTS) +args-for-test.o: CFLAGS_FOR_SOURCE = \ + -DNATIVE_ENDIAN_VAL=$(NATIVE_ENDIAN_VAL) \ + -DNATIVE_POINTER_SIZE=$(NATIVE_POINTER_SIZE) +$(DWZ_TEST_OBJECTS): %-for-test.o : %.c + $(CC) $< -o $@ -c \ + -DUSE_GNUC=0 -DDEVEL \ + -O2 -g \ + $(CFLAGS_COMMON) \ + -DDWZ_VERSION='"for-test"' \ + $(CFLAGS_COPYRIGHT) \ + $(CFLAGS_FOR_SOURCE) min: $(CC) $(TEST_SRC)/min.c $(TEST_SRC)/min-2.c -o $@ -g @@ -96,11 +137,11 @@ export DEJAGNU=$(DEJAGNU); \ runtest --tool=dwz -srcdir $(srcdir)/testsuite/ lib/$*.exp -$(filter-out no-multifile-prop, $(TEST_EXECS_DWARF_ASM)): %: %-dw.S +$(filter-out no-multifile-prop unavailable-dwarf-piece, $(TEST_EXECS_DWARF_ASM)): %: %-dw.S $(CC) $(TEST_SRC)/main.c $< -o $@ # Fails to compile on riscv64: Error: non-constant .uleb128 is not supported. -no-multifile-prop: %: %-dw.S +no-multifile-prop unavailable-dwarf-piece: %: %-dw.S $(CC) $(TEST_SRC)/main.c $< -o $@ || true odr-struct: @@ -136,14 +177,25 @@ $(CXX) $(TEST_SRC)/decl.cc $(TEST_SRC)/def.cc $(TEST_SRC)/def2.cc \ -I$(TEST_SRC) -o $@ -g +cycle: + $(CC) $(TEST_SRC)/cycle.c -o $@ -g + # On some systems we need to set and export DEJAGNU to suppress # WARNING: Couldn't find the global config file. DEJAGNU ?= /dev/null -check: dwz $(TEST_EXECS) +VALGRIND_OPTIONS = -q --error-exitcode=99 + +check check-valgrind: dwz $(TEST_EXECS) mkdir -p testsuite-bin - cd testsuite-bin; ln -sf $(PWD)/dwz . + cd testsuite-bin; \ + if "$@" = "check" ; then \ + ln -sf $(PWD)/dwz .; \ + else \ + echo "valgrind $(VALGRIND_OPTIONS) $(PWD)/dwz \"\$$@\"" > dwz; \ + chmod +x dwz; \ + fi export DEJAGNU=$(DEJAGNU); \ export PATH=$(PWD)/testsuite-bin:$$PATH; export LC_ALL=C; \ runtest --tool=dwz -srcdir $(srcdir)/testsuite $(RUNTESTFLAGS) - rm -Rf testsuite-bin $(TEST_EXECS) $(DWZ_TEST_SOURCES) + rm -Rf testsuite-bin $(TEST_EXECS) $(DWZ_TEST_OBJECTS)
View file
_service:tar_scm:dwz-0.15.tar.xz/README.release-checklist
Added
@@ -0,0 +1,28 @@ +- Verify that copyright notices in source files are up-to-date. +- Update COPYRIGHT_YEARS using contrib/release/gen-copyright-years.sh. + Commit modifications if there are any. +- Run contrib/release/do-release.sh. + Use: + - --minor to do a minor update: $maj.$min -> $maj.$(($min + 1)) + - --major to do a major update: $maj.$min -> $(($maj + 1)).0 + This: + - adds a commit that updates the VERSION file, + - creates a signed annotated release tag for that commit, and + - pushes both the commit and the tag to the remote repository. +- Run contrib/release/upload-release.sh. + This creates and uploads two release tarballs. +- Write draft release announcement. + F.i. using template of + https://sourceware.org/ml/gdb-announce/2019/msg00001.html. +- Sent out draft release announcement to maintainers for review and + further contributions. +- Sent out release announcement. Sent to: + - Maintainers + - dwz@sourceware.org + - dwarf-discuss@lists.dwarfstd.org + - gcc@gcc.gnu.org + - gdb@sourceware.org + - lldb-dev@lists.llvm.org +- Update web page ( https://sourceware.org/dwz/ ): + - Add news item with hlink to release annoucement. + - Add entry in release list.
View file
_service:tar_scm:dwz-0.14.tar.xz/VERSION -> _service:tar_scm:dwz-0.15.tar.xz/VERSION
Changed
@@ -1,1 +1,1 @@ -0.14 +0.15
View file
_service:tar_scm:dwz-0.15.tar.xz/args.c
Added
@@ -0,0 +1,743 @@ +/* Copyright (C) 2001-2021 Red Hat, Inc. + Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2019-2021 SUSE LLC. + Written by Jakub Jelinek <jakub@redhat.com>, 2012. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include <assert.h> +#include <getopt.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <error.h> +#include <gelf.h> +#include <sys/sysinfo.h> + +#include "args.h" + +#include "util.h" + +#if DEVEL +int tracing; +int ignore_size; +int ignore_locus; +int dump_checksum_p; +int dump_dies_p; +int dump_dups_p; +int dump_pus_p; +int verify_dups_p; +int verify_edge_freelist; +int stats_p; +int checksum_cycle_opt = 1; +int skip_producers_p; +#endif + +int unoptimized_multifile; +int save_temps; +int verify_edges_p; +int dump_edges_p; +int partition_dups_opt; +int progress_p; +int progress_mem_p; +int import_opt_p = 1; +int force_p; +int max_forks = -1; + +enum deduplication_mode deduplication_mode = dm_inter_cu; + +int uni_lang_p = 0; +int gen_cu_p = 0; + +enum die_count_methods die_count_method = estimate; + +int odr = 0; +enum odr_mode odr_mode = ODR_LINK; + +/* Filename if inter-file size optimization should be performed. */ +const char *multifile; + +/* Argument of -M option, i.e. preferred name that should be stored + into the .gnu_debugaltlink or .debug_sup section. */ +const char *multifile_name; + +/* True if -r option is present, i.e. .gnu_debugaltlink or .debug_sup section + should contain a filename relative to the directory in which + the particular file is present. */ +bool multifile_relative; + +/* Pointer size of multifile. */ +int multifile_force_ptr_size; +/* Endianity of multifile. */ +int multifile_force_endian; + +/* True if DWARF 5 .debug_sup and DW_FORM_ref_sup4 / DW_FORM_strp_sup + should be used instead of the GNU extensions .gnu_debugaltlink + and DW_FORM_GNU_ref_alt / DW_FORM_GNU_strp_alt etc. */ +bool dwarf_5; + +/* True if -q option has been passed. */ +bool quiet; + +/* Number of DIEs, above which dwz retries processing + in low_mem mode (and give up on multifile optimizing + the file in question). */ +unsigned int low_mem_die_limit = 10000000; + +/* Number of DIEs, above which dwz gives up processing + input altogether. */ +unsigned int max_die_limit = 50000000; + +/* Phase of multifile handling. */ +unsigned char multifile_mode; + +static int die_count_method_parsed; +static int deduplication_mode_parsed; +static int odr_mode_parsed; +static int skip_producer_parsed; + +/* Options for getopt_long. */ +static struct option dwz_options = +{ + { "help", no_argument, 0, '?' }, + { "output", required_argument, 0, 'o' }, + { "multifile", required_argument, 0, 'm' }, + { "quiet", no_argument, 0, 'q' }, + { "hardlink", no_argument, 0, 'h' }, + { "low-mem-die-limit", required_argument, 0, 'l' }, + { "max-die-limit", required_argument, 0, 'L' }, + { "multifile-name", required_argument, 0, 'M' }, + { "relative", no_argument, 0, 'r' }, + { "version", no_argument, 0, 'v' }, + { "import-optimize", + no_argument, &import_opt_p, 1 }, + { "no-import-optimize", + no_argument, &import_opt_p, 0 }, + { "dwarf-5", no_argument, 0, '5' }, +#if DEVEL + { "devel-trace", no_argument, &tracing, 1 }, + { "devel-progress", no_argument, &progress_p, 1 }, + { "devel-progress-mem",no_argument, &progress_mem_p, 1 }, + { "devel-ignore-size", no_argument, &ignore_size, 1 }, + { "devel-ignore-locus",no_argument, &ignore_locus, 1 }, + { "devel-force", no_argument, &force_p, 1 }, + { "devel-save-temps", no_argument, &save_temps, 1 }, + { "devel-dump-checksum", + no_argument, &dump_checksum_p, 1 }, + { "devel-dump-dies", no_argument, &dump_dies_p, 1 }, + { "devel-dump-dups", no_argument, &dump_dups_p, 1 }, + { "devel-dump-pus", no_argument, &dump_pus_p, 1 }, + { "devel-unoptimized-multifile", + no_argument, &unoptimized_multifile, 1 }, + { "devel-verify-edges",no_argument, &verify_edges_p, 1 }, + { "devel-verify-dups", no_argument, &verify_dups_p, 1 }, + { "devel-dump-edges", no_argument, &dump_edges_p, 1 }, + { "devel-partition-dups-opt", + no_argument, &partition_dups_opt, 1 }, + { "devel-die-count-method", + required_argument, &die_count_method_parsed, 1 }, + { "devel-stats", no_argument, &stats_p, 1 }, + { "devel-deduplication-mode", + required_argument, &deduplication_mode_parsed, 1 }, + { "devel-uni-lang", + no_argument, &uni_lang_p, 1 }, + { "devel-no-uni-lang", + no_argument, &uni_lang_p, 0 }, + { "devel-gen-cu", + no_argument, &gen_cu_p, 1 }, + { "devel-no-gen-cu", + no_argument, &gen_cu_p, 0 }, + { "devel-checksum-cycle-opt", + no_argument, &checksum_cycle_opt, 1 }, + { "devel-no-checksum-cycle-opt", + no_argument, &checksum_cycle_opt, 0 }, + { "devel-skip-producer", + required_argument, &skip_producer_parsed, 1}, +#endif + { "odr", no_argument, &odr, 1 }, + { "no-odr", no_argument, &odr, 0 }, + { "odr-mode", required_argument, &odr_mode_parsed, 1 }, + { "multifile-pointer-size", + required_argument, 0, 'p' }, + { "multifile-endian", + required_argument, 0, 'e' }, + { "jobs", required_argument, 0, 'j' }, + { NULL, no_argument, 0, 0 } +}; + +/* Struct describing various usage aspects of a command line option. */ +struct option_help +{ + const char *short_name; + const char *long_name; + const char *argument; + const char *default_value; + const char *msg; +}; + +/* Describe common command line options. */ +static struct option_help dwz_common_options_help = +{ + { "q", "quiet", NULL, NULL, + "Silence up the most common messages." }, + { "l", "low-mem-die-limit", "<COUNT|none>", "10 million DIEs", + "Handle files larger than this limit using a slower and more memory"
View file
_service:tar_scm:dwz-0.15.tar.xz/args.h
Added
@@ -0,0 +1,97 @@ +/* Copyright (C) 2001-2021 Red Hat, Inc. + Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2019-2021 SUSE LLC. + Written by Jakub Jelinek <jakub@redhat.com>, 2012. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#if DEVEL +extern int tracing; +extern int ignore_size; +extern int ignore_locus; +extern int dump_checksum_p; +extern int dump_dies_p; +extern int dump_dups_p; +extern int dump_pus_p; +extern int verify_dups_p; +extern int verify_edge_freelist; +extern int stats_p; +extern int checksum_cycle_opt; +extern int skip_producers_p; +#else +#define tracing 0 +#define ignore_size 0 +#define ignore_locus 0 +#define dump_checksum_p 0 +#define dump_dies_p 0 +#define dump_dups_p 0 +#define dump_pus_p 0 +#define verify_dups_p 0 +#define stats_p 0 +#define checksum_cycle_opt 1 +#define skip_producers_p 0 +#endif + +extern int unoptimized_multifile; +extern int save_temps; +extern int verify_edges_p; +extern int dump_edges_p; +extern int partition_dups_opt; +extern int progress_p; +extern int progress_mem_p; +extern int import_opt_p; +extern int force_p; +extern int max_forks; + +enum deduplication_mode +{ + dm_none, + dm_intra_cu, + dm_inter_cu +}; +extern enum deduplication_mode deduplication_mode; + +extern int uni_lang_p; +extern int gen_cu_p; + +enum die_count_methods +{ + none, + estimate +}; +extern enum die_count_methods die_count_method; + +extern int odr; +enum odr_mode { ODR_BASIC, ODR_LINK }; +extern enum odr_mode odr_mode; + +extern const char *multifile; +extern const char *multifile_name; +extern bool multifile_relative; +extern int multifile_force_ptr_size; +extern int multifile_force_endian; + +extern unsigned char multifile_mode; + +extern bool dwarf_5; + +extern bool quiet; + +extern unsigned int low_mem_die_limit; +extern unsigned int max_die_limit; + +extern void parse_args (int, char *, bool *, const char **); +extern bool skip_producer (const char *producer);
View file
_service:tar_scm:dwz-0.14.tar.xz/contrib/bytes-per-die.sh -> _service:tar_scm:dwz-0.15.tar.xz/contrib/bytes-per-die.sh
Changed
@@ -3,7 +3,7 @@ f="$1" size=$(readelf -WS "$f" \ - | egrep " \t\.debug_info" \ + | grep -E " \t\.debug_info" \ | sed 's/.*\.debug_info//' \ | awk '{print $4}') size=$((16#$size))
View file
_service:tar_scm:dwz-0.14.tar.xz/contrib/release/do-release.sh -> _service:tar_scm:dwz-0.15.tar.xz/contrib/release/do-release.sh
Changed
@@ -52,10 +52,16 @@ version=$major.$minor +set +x + echo $version > VERSION git add VERSION git commit -m "Bump version to $version" -git tag dwz-$version +git push origin master:master + +git tag -s -m "dwz $version release" dwz-$version + +git push origin dwz-$version
View file
_service:tar_scm:dwz-0.14.tar.xz/contrib/release/gen-copyright-years.sh -> _service:tar_scm:dwz-0.15.tar.xz/contrib/release/gen-copyright-years.sh
Changed
@@ -128,6 +128,8 @@ tmp=$(mktemp) for f in *.c *.h *.def; do + if test "$f" = "native.c"; then continue; fi + if ! grep -q "Copyright (C)" $f; then echo "error: found file without copyright marker: $f" exit 1
View file
_service:tar_scm:dwz-0.14.tar.xz/contrib/release/upload-release.sh -> _service:tar_scm:dwz-0.15.tar.xz/contrib/release/upload-release.sh
Changed
@@ -4,7 +4,7 @@ pwd=$(pwd -P) -version="$1" +version=$(cat VERSION) tag=dwz-$version rootdir=dwz
View file
_service:tar_scm:dwz-0.14.tar.xz/dwz.1 -> _service:tar_scm:dwz-0.15.tar.xz/dwz.1
Changed
@@ -77,6 +77,16 @@ of the \fB-m\fR option. Either \fB-M\fR or \fB-r\fR option can be specified, but not both. .TP +.B \-p N \-\-multifile-pointer-size <N|auto|native> +Specify the pointer size of the multifile, in bytes. If auto, use the +pointer size of the files, provided they match. If native, use native pointer +size, as specified in the help message. +.TP +.B \-p <l|b|auto> \-\-multifile-endian <l|b|auto|native> +Specify the endianity of the multifile. If auto, use the endianity of +the files, provided they match. If native, use native endianity, as specified +in the help message. +.TP .B \-q \-\-quiet Silence up some of the most common messages. .TP @@ -111,6 +121,10 @@ corresponding forms, instead of the GNU extension \fI.gnu_debugaltlink\fR and corresponding forms. .TP +.B \-j <N> \-\-jobs <N> +Process \fIN\fR files in parallel. The default is processors / 2. Disabled +when multifile is used. +.TP .B \-\-odr / \-\-no-odr .B Experimental. Enable/disable One-Definition-Rule optimization for C++ compilation units.
View file
_service:tar_scm:dwz-0.14.tar.xz/dwz.c -> _service:tar_scm:dwz-0.15.tar.xz/dwz.c
Changed
@@ -22,7 +22,6 @@ #include <errno.h> #include <error.h> #include <fcntl.h> -#include <getopt.h> #include <setjmp.h> #include <string.h> #include <stdbool.h> @@ -35,13 +34,19 @@ #include <sys/stat.h> #include <sys/types.h> #include <sys/times.h> +#include <sys/wait.h> #include <obstack.h> #include <gelf.h> +#include <xxhash.h> + #include "dwarf2.h" #include "hashtab.h" #include "sha1.h" +#include "args.h" +#include "util.h" +#include "pool.h" #ifndef SHF_COMPRESSED /* Glibc elf.h contains SHF_COMPRESSED starting v2.22. Libelf libelf.h has @@ -109,29 +114,41 @@ # define NT_GNU_BUILD_ID 3 #endif -#if defined __GNUC__ && __GNUC__ >= 3 -# define likely(x) __builtin_expect (!!(x), 1) -# define unlikely(x) __builtin_expect (!!(x), 0) -#else -# define likely(x) (x) -# define unlikely(x) (x) -#endif +/* xxHash state object. Init in main. */ +static XXH64_state_t *state; -#if defined __GNUC__ -# define FORCE_INLINE __attribute__((always_inline)) -# define UNUSED __attribute__((unused)) -# define USED __attribute__((used)) -#else -# define FORCE_INLINE -# define UNUSED -# define USED -#endif +/* Clear xxHash state to zero. */ +#define hash_init_state() XXH64_reset(state, 0) + +/* Update hash STATE with VALUE. */ +#define hash_update_state_object(value) XXH64_update(state, &value, sizeof value) -/* Utility macro. */ -#define IMPLIES(A, B) (!((A) && !(B))) -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) +/* Update hash STATE with OBJECT that has a provided SIZE. */ +#define hash_update_state(object, size) XXH64_update(state, object, size) +/* Get digest once we are done with a state. */ +#define hash_digest() XXH64_digest(state) + +/* Shorthand for hashing something with an intrinsic size. */ +#define hash(IN,LEN) XXH64(IN, LEN, 0) +#define iterative_hash(IN,LEN,INIT) XXH64(IN, LEN, INIT) +#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT) + +/* Print memory amount M (in kb) in both exact and human readable, like so: + 1382508 (1.3G). */ +static void +print_mem (long m) +{ + float h = m; + int level = 0; + const char *unit = { "K", "M", "G"}; + while (h > 1024 && level <= 2) + { + h = h / 1024; + level++; + } + fprintf (stderr, "%ld (%.1f%s)\n", m, h, unitlevel); +} static void report_progress (void) @@ -157,6 +174,40 @@ clock_t sys = current.tms_stime - prev.tms_stime; fprintf (stderr, "user: %.2f\n", (float)user / (float)ticks_per_second); fprintf (stderr, "sys : %.2f\n", (float)sys / (float)ticks_per_second); + + if (progress_mem_p) + { + FILE *s = fopen ("/proc/self/status", "r"); + char *p; + bool print_next = false; + for (p = NULL; fscanf (s, "%ms", &p) && p != NULL; free (p)) + { + if (print_next) + { + long mem = strtol (p, NULL, 10); + print_mem (mem); + print_next = false; + continue; + } + + if (!(p0 == 'V' && p1 == 'm')) + continue; + + if (strcmp (&p2, "Peak:") == 0) + fprintf (stderr, "VM Peak: "); + else if (strcmp (&p2, "Size:") == 0) + fprintf (stderr, "VM Current: "); + else if (strcmp (&p2, "HWM:") == 0) + fprintf (stderr, "RSS Peak: "); + else if (strcmp (&p2, "RSS:") == 0) + fprintf (stderr, "RSS Current: "); + else + continue; + + print_next = true; + } + fclose (s); + } } #define obstack_chunk_alloc malloc @@ -168,7 +219,7 @@ /* Handle OOM situation. If handling more than one file, we might just fail to handle some large file due to OOM, but could very well handle other smaller files after it. */ -static void +void dwz_oom (void) { longjmp (oom_buf, 1); @@ -184,57 +235,7 @@ and restored during final cleanup. */ static struct obstack alt_ob, alt_ob2; -#if DEVEL -static int tracing; -static int ignore_size; -static int ignore_locus; -static int dump_checksum_p; -static int dump_dies_p; -static int dump_dups_p; -static int dump_pus_p; -static int verify_dups_p; -static int verify_edge_freelist; -static int stats_p; -#else -#define tracing 0 -#define ignore_size 0 -#define ignore_locus 0 -#define dump_checksum_p 0 -#define dump_dies_p 0 -#define dump_dups_p 0 -#define dump_pus_p 0 -#define verify_dups_p 0 -#define stats_p 0 -#endif -static int unoptimized_multifile; -static int save_temps = 0; -static int verify_edges_p = 0; -static int dump_edges_p = 0; -static int partition_dups_opt; -static int progress_p; -static int import_opt_p = 1; -static int force_p = 0; -enum deduplication_mode -{ - dm_none, - dm_intra_cu, - dm_inter_cu -}; -static enum deduplication_mode deduplication_mode = dm_inter_cu; -static int uni_lang_p = 0; -static int gen_cu_p = 0; -enum die_count_methods -{ - none, - estimate -}; -static enum die_count_methods die_count_method = estimate; - -int odr = 0; -enum odr_mode { ODR_BASIC, ODR_LINK }; -enum odr_mode odr_mode = ODR_LINK; -int odr_mode_parsed = 0; -bool odr_active_p = false; +static bool odr_active_p = false; /* Struct to gather statistics. */ struct stats @@ -253,7 +254,7 @@
View file
_service:tar_scm:dwz-0.14.tar.xz/hashtab.c -> _service:tar_scm:dwz-0.15.tar.xz/hashtab.c
Changed
@@ -626,142 +626,3 @@ fclose (f); } #endif - -/* DERIVED FROM: --------------------------------------------------------------------- -lookup2.c, by Bob Jenkins, December 1996, Public Domain. -hash(), hash2(), hash3, and mix() are externally useful functions. -Routines to test the hash are included if SELF_TEST is defined. -You can use this free for any purpose. It has no warranty. --------------------------------------------------------------------- -*/ - -/* --------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. -For every delta with one or two bit set, and the deltas of all three - high bits or all three low bits, whether the original value of a,b,c - is almost all zero or is uniformly distributed, -* If mix() is run forward or backward, at least 32 bits in a,b,c - have at least 1/4 probability of changing. -* If mix() is run forward, every bit of c will change between 1/3 and - 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.) -mix() was built out of 36 single-cycle latency instructions in a - structure that could supported 2x parallelism, like so: - a -= b; - a -= c; x = (c>>13); - b -= c; a ^= x; - b -= a; x = (a<<8); - c -= a; b ^= x; - c -= b; x = (b>>13); - ... - Unfortunately, superscalar Pentiums and Sparcs can't take advantage - of that parallelism. They've also turned some of those single-cycle - latency instructions into multi-cycle latency instructions. Still, - this is the fastest good hash I could find. There were about 2^^68 - to choose from. I only looked at a billion or so. --------------------------------------------------------------------- -*/ -/* same, but slower, works on systems that might have 8 byte hashval_t's */ -#define mix(a,b,c) \ -{ \ - a -= b; a -= c; a ^= (c>>13); \ - b -= c; b -= a; b ^= (a<< 8); \ - c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \ - a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \ - b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \ - c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \ - a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \ - b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \ - c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \ -} - -/* --------------------------------------------------------------------- -hash() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - len : the length of the key, counting by bytes - level : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Every 1-bit and 2-bit delta achieves avalanche. -About 36+6len instructions. - -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (ub1 **)k, do it like this: - for (i=0, h=0; i<n; ++i) h = hash( ki, leni, h); - -By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this -code any way you wish, private, educational, or commercial. It's free. - -See http://burtleburtle.net/bob/hash/evahash.html -Use for hash table lookup, or anything where one collision in 2^32 is -acceptable. Do NOT use for cryptographic purposes. --------------------------------------------------------------------- -*/ - -hashval_t -iterative_hash (const void *k_in /* the key */, - register size_t length /* the length of the key */, - register hashval_t initval /* the previous hash, or - an arbitrary value */) -{ - register const unsigned char *k = (const unsigned char *)k_in; - register hashval_t a,b,c,len; - - /* Set up the internal state */ - len = length; - a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */ - c = initval; /* the previous hash value */ - - /*---------------------------------------- handle most of the key */ -#ifndef WORDS_BIGENDIAN - /* On a little-endian machine, if the data is 4-byte aligned we can hash - by word for better speed. This gives nondeterministic results on - big-endian machines. */ - if (sizeof (hashval_t) == 4 && (((size_t)k)&3) == 0) - while (len >= 12) /* aligned */ - { - a += *(hashval_t *)(k+0); - b += *(hashval_t *)(k+4); - c += *(hashval_t *)(k+8); - mix(a,b,c); - k += 12; len -= 12; - } - else /* unaligned */ -#endif - while (len >= 12) - { - a += (k0 +((hashval_t)k1<<8) +((hashval_t)k2<<16) +((hashval_t)k3<<24)); - b += (k4 +((hashval_t)k5<<8) +((hashval_t)k6<<16) +((hashval_t)k7<<24)); - c += (k8 +((hashval_t)k9<<8) +((hashval_t)k10<<16)+((hashval_t)k11<<24)); - mix(a,b,c); - k += 12; len -= 12; - } - - /*------------------------------------- handle the last 11 bytes */ - c += length; - switch(len) /* all the case statements fall through */ - { - case 11: c+=((hashval_t)k10<<24); /* fall through */ - case 10: c+=((hashval_t)k9<<16); /* fall through */ - case 9 : c+=((hashval_t)k8<<8); /* fall through */ - /* the first byte of c is reserved for the length */ - case 8 : b+=((hashval_t)k7<<24); /* fall through */ - case 7 : b+=((hashval_t)k6<<16); /* fall through */ - case 6 : b+=((hashval_t)k5<<8); /* fall through */ - case 5 : b+=k4; /* fall through */ - case 4 : a+=((hashval_t)k3<<24); /* fall through */ - case 3 : a+=((hashval_t)k2<<16); /* fall through */ - case 2 : a+=((hashval_t)k1<<8); /* fall through */ - case 1 : a+=k0; - /* case 0: nothing left to add */ - } - mix(a,b,c); - /*-------------------------------------------- report the result */ - return c; -}
View file
_service:tar_scm:dwz-0.14.tar.xz/hashtab.h -> _service:tar_scm:dwz-0.15.tar.xz/hashtab.h
Changed
@@ -153,11 +153,6 @@ #endif -/* An iterative hash function for arbitrary data. */ -extern hashval_t iterative_hash (const void *, size_t, hashval_t); -/* Shorthand for hashing something with an intrinsic size. */ -#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT) - #ifdef __cplusplus } #endif /* __cplusplus */
View file
_service:tar_scm:dwz-0.15.tar.xz/pool.c
Added
@@ -0,0 +1,103 @@ +/* Copyright (C) 2001-2021 Red Hat, Inc. + Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2019-2021 SUSE LLC. + Written by Jakub Jelinek <jakub@redhat.com>, 2012. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* Big pool allocator. obstack isn't efficient, because it aligns everything + too much, and allocates too small chunks. All these objects are only freed + together. */ + +#include <stddef.h> +#include <stdlib.h> +#include <inttypes.h> + +#include "pool.h" + +/* Pointer to the start of the current pool chunk, current first free byte + in the chunk and byte after the end of the current pool chunk. */ + +static unsigned char *pool, *pool_next, *pool_limit; + +extern void dwz_oom (void); + +/* Allocate SIZE bytes with ALIGN bytes alignment from the pool. */ +void * +pool_alloc_1 (unsigned int align, unsigned int size) +{ + void *ret; + if (pool == NULL + || (size_t) (pool_limit - pool_next) < (size_t) align + size) + { + size_t new_size = (size_t) align + size; + unsigned char *new_pool; + new_size += sizeof (void *); + if (new_size < 16384 * 1024 - 64) + new_size = 16384 * 1024 - 64; + new_pool = (unsigned char *) malloc (new_size); + if (new_pool == NULL) + dwz_oom (); + *(unsigned char **) new_pool = pool; + pool_next = new_pool + sizeof (unsigned char *); + pool_limit = new_pool + new_size; + pool = new_pool; + } + pool_next = (unsigned char *) (((uintptr_t) pool_next + align - 1) + & ~(uintptr_t) (align - 1)); + ret = pool_next; + pool_next += size; + return ret; +} + +/* Finalize a pool and return it. */ +unsigned char * +finalize_pool (void) +{ + unsigned char *ret = pool; + pool = NULL; + pool_next = NULL; + pool_limit = NULL; + return ret; +} + +/* Free pool P. */ +static void +pool_destroy_1 (unsigned char *p) +{ + while (p) + { + void *elem = (void *) p; + p = *(unsigned char **) p; + free (elem); + } +} + +/* Free pool P, or the current pool if NULL. */ +void +pool_destroy (unsigned char *p) +{ + if (p != NULL) + { + pool_destroy_1 (p); + return; + } + + pool_destroy_1 (pool); + pool = NULL; + pool_next = NULL; + pool_limit = NULL; +}
View file
_service:tar_scm:dwz-0.15.tar.xz/pool.h
Added
@@ -0,0 +1,26 @@ +/* Copyright (C) 2001-2021 Red Hat, Inc. + Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2019-2021 SUSE LLC. + Written by Jakub Jelinek <jakub@redhat.com>, 2012. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +extern void *pool_alloc_1 (unsigned int, unsigned int); +extern unsigned char *finalize_pool (void); +extern void pool_destroy (unsigned char *); + +#define pool_alloc(name, size) \ + (struct name *) pool_alloc_1 (ALIGNOF_STRUCT (name), size)
View file
_service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/cycle.c
Added
@@ -0,0 +1,13 @@ +struct s; + +struct s { + struct s *p; +}; + +struct s var; + +int +main (void) +{ + return 0; +}
View file
_service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/cycle.sh
Added
@@ -0,0 +1,36 @@ +readelf_flags="" +if readelf -h 2>&1 | grep -q "\-wN"; then + readelf_flags=-wN +fi + +cp $execs/cycle 1 + +# Using mode 3 in checksum_die_ref. +$execs/dwz-for-test 1 -o 1.z --devel-dump-dies 2> DUMP.1 +rm -f 1.z + +# Skipping mode 3 in checksum_die_ref. +$execs/dwz-for-test 1 -o 1.z --devel-dump-dies --devel-no-checksum-cycle-opt 2> DUMP.2 +rm -f 1.z + +# Verify that mode 3 and mode 4 have different checksums. +grep " s structure_type" DUMP.1 > LINE.1 +grep " s structure_type" DUMP.2 > LINE.2 +! diff -q LINE.1 LINE.2 +rm -f DUMP.1 DUMP.2 LINE.1 LINE.2 + +# Verify that dwz actually works with --devel-no-checksum-cycle-opt. +cp 1 2 +$execs/dwz-for-test -m 3 1 2 --devel-no-checksum-cycle-opt --devel-ignore-size + +cnt=$(readelf -wi 3 | grep -c "DW_AT_name.*: s$") + $cnt -eq 1 + +# Even with -wN readelf 2.38-15.fc37 follows and prints the contents +# of the alt file. So make sure it cannot do that by removing it. +rm 3 + +cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*: s$" || true) + $cnt -eq 0 + +rm -f 1 2 3
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/devel-ignore-locus.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/devel-ignore-locus.sh
Changed
@@ -6,7 +6,7 @@ $cnt -eq 2 - $execs/dwz-for-test 1 2>/dev/null +$execs/dwz-for-test 1 2>/dev/null cnt=$(readelf -wi 1 \ | grep 'DW_AT_name.*: aaa' \ @@ -16,7 +16,7 @@ cp $execs/two-typedef 1 - $execs/dwz-for-test --devel-ignore-locus --devel-ignore-size 1 +$execs/dwz-for-test --devel-ignore-locus --devel-ignore-size 1 cnt=$(readelf -wi 1 \ | grep 'DW_AT_name.*: aaa' \
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/devel-ignore-size.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/devel-ignore-size.sh
Changed
@@ -6,7 +6,7 @@ $cnt -eq 0 - $execs/dwz-for-test 1 2>/dev/null +$execs/dwz-for-test 1 2>/dev/null cnt=$(readelf -wi 1 \ | grep '(DW_TAG_partial_unit' \ @@ -18,7 +18,7 @@ cp $execs/min 1 - $execs/dwz-for-test --devel-ignore-size 1 +$execs/dwz-for-test --devel-ignore-size 1 cnt=$(readelf -wi 1 \ | grep '(DW_TAG_partial_unit' \
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/devel-trace.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/devel-trace.sh
Changed
@@ -1,5 +1,5 @@ cp $execs/hello 1 - $execs/dwz-for-test --devel-trace 1 2>/dev/null +$execs/dwz-for-test --devel-trace 1 2>/dev/null rm -f 1
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/dw2-skip-prologue.S -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/dw2-skip-prologue.S
Changed
@@ -400,3 +400,4 @@ .byte 1 .Lline1_end: + .section .note.GNU-stack,"",@progbits
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/gdb-add-index.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/gdb-add-index.sh
Changed
@@ -1,6 +1,8 @@ cp $execs/hello 1 -gdb-add-index 1 +# Redirect gdb-add-index stderr to stdout. +# https://sourceware.org/bugzilla/show_bug.cgi?id=29316 +gdb-add-index 1 2>&1 readelf -S 1 | grep -q '\.gdb_index'
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/implptr-64bit-d2o4a8r8t0.S -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/implptr-64bit-d2o4a8r8t0.S
Changed
@@ -154,3 +154,4 @@ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ + .section .note.GNU-stack,"",@progbits
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/odr-struct-multifile.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/odr-struct-multifile.sh
Changed
@@ -2,6 +2,11 @@ exit 77 fi +readelf_flags="" +if readelf -h 2>&1 | grep -q "\-wN"; then + readelf_flags=-wN +fi + cp $execs/odr-struct 1 cp 1 2 @@ -39,14 +44,17 @@ $cnt -eq 1 done +# Even with -wN readelf 2.38-15.fc37 follows and prints the contents +# of the alt file. So make sure it cannot do that by removing it. +rm 3 for name in aaa bbb ccc; do - cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true) + cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true) $cnt -eq 0 done for name in member_one member_two member_three member_four; do - cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true) + cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true) $cnt -eq 0 done
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/odr-struct-ns.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/odr-struct-ns.sh
Changed
@@ -21,7 +21,10 @@ esac done -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) +# Check that bbb and ccc are present as DW_AT_declaration +readelf -wi 1 | grep -3 DW_AT_declaration > decls +grep bbb decls >/dev/null +grep ccc decls >/dev/null $execs/dwz-for-test --odr 1 @@ -38,8 +41,9 @@ done # We expect two decls to be removed, for bbb and ccc. -expected_decl_cnt=$(($decl_cnt - 2)) -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) - $expected_decl_cnt -eq $decl_cnt +readelf -wi 1 | grep -3 DW_AT_declaration > decls || true -rm -f 1 +if grep bbb decls >/dev/null ; then exit 1; fi +if grep ccc decls >/dev/null ; then exit 2; fi + +rm -f 1 decls
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/odr-struct.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/odr-struct.sh
Changed
@@ -21,7 +21,10 @@ esac done -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) +# Check that bbb and ccc are present as DW_AT_declaration +readelf -wi 1 | grep -3 DW_AT_declaration > decls +grep bbb decls >/dev/null +grep ccc decls >/dev/null $execs/dwz-for-test --odr 1 @@ -38,8 +41,9 @@ done # We expect two decls to be removed, for bbb and ccc. -expected_decl_cnt=$(($decl_cnt - 2)) -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) - $expected_decl_cnt -eq $decl_cnt +readelf -wi 1 | grep -3 DW_AT_declaration > decls || true -rm -f 1 +if grep bbb decls >/dev/null ; then exit 1; fi +if grep ccc decls >/dev/null ; then exit 2; fi + +rm -f 1 decls
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/pr24747.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/pr24747.sh
Changed
@@ -4,6 +4,4 @@ dwz 1 -smaller-than.sh 1 $exec - rm -f 1
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/twice-multifile.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/twice-multifile.sh
Changed
@@ -24,7 +24,10 @@ exit 1 fi - $status -eq 0 +if $status -ne 0 ; then + cat dwz.err + exit 1 +fi smaller-than.sh 1 1.saved
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/two-files-low-mem-die-limit-0.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/two-files-low-mem-die-limit-0.sh
Changed
@@ -5,9 +5,10 @@ -l0 \ --devel-trace \ 1 2 \ + -j 1 \ 2> dwz.err -if egrep -q "Compressing (1|2)$" dwz.err; then +if grep -Eq "Compressing (1|2)$" dwz.err; then exit 1 fi
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/dwz.tests/varval.S -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/dwz.tests/varval.S
Changed
@@ -512,3 +512,4 @@ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ + .section .note.GNU-stack,"",@progbits
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/lib/dwarf.exp -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/lib/dwarf.exp
Changed
@@ -1666,6 +1666,8 @@ _write_deferred_output + _section .note.GNU-stack "" progbits + catch {close $_output_file} set _output_file {} }
View file
_service:tar_scm:dwz-0.14.tar.xz/testsuite/scripts/smaller-than.sh -> _service:tar_scm:dwz-0.15.tar.xz/testsuite/scripts/smaller-than.sh
Changed
@@ -1,10 +1,45 @@ -#!/bin/sh +#!/bin/bash f1=$1 f2=$2 -s1=$(ls -l $f1 | awk '{print $5}') -s2=$(ls -l $f2 | awk '{print $5}') +section_size () +{ + local f="$1" + local section="$2" + + local s + s=$(readelf -S -W $f \ + | grep "\.debug_$section" \ + | sed 's/.*\.debug_//' \ + | awk '{print $5}') + + if "$s" = "" ; then + echo 0 + return + fi + + # Convert hex to decimal. + s=$(printf "%d" $((16#$s))) + + echo $s +} + +size () +{ + local f="$1" + + local total=0 + local section + for section in info abbrev str macro types; do + total=$(($total + $(section_size $f $section))) + done + + echo $total +} + +s1=$(size $f1) +s2=$(size $f2) if $s1 -ge $s2 ; then exit 1
View file
_service:tar_scm:dwz-0.15.tar.xz/util.h
Added
@@ -0,0 +1,63 @@ +/* Copyright (C) 2001-2021 Red Hat, Inc. + Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2019-2021 SUSE LLC. + Written by Jakub Jelinek <jakub@redhat.com>, 2012. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* Utility macros. */ + +#define IMPLIES(A, B) (!((A) && !(B))) + +#define MAX(A, B) ((A) > (B) ? (A) : (B)) +#define MIN(A, B) ((A) < (B) ? (A) : (B)) + +#define XSTR(s) STR(s) +#define STR(s) #s + +#ifndef USE_GNUC +#ifdef __GNUC__ +#define USE_GNUC 1 +#else +#define USE_GNUC 0 +#endif +#endif + +#if USE_GNUC && __GNUC__ >= 3 +# define likely(x) __builtin_expect (!!(x), 1) +# define unlikely(x) __builtin_expect (!!(x), 0) +#else +# define likely(x) (x) +# define unlikely(x) (x) +#endif + +#if USE_GNUC +# define FORCE_INLINE __attribute__((always_inline)) +# define UNUSED __attribute__((unused)) +# define USED __attribute__((used)) +#else +# define FORCE_INLINE +# define UNUSED +# define USED +#endif + +#if USE_GNUC +# define ALIGN_STRUCT(name) +# define ALIGNOF_STRUCT(name) __alignof__ (struct name) +#else +# define ALIGN_STRUCT(name) struct align_##name { char c; struct name s; }; +# define ALIGNOF_STRUCT(name) offsetof (struct align_##name, s) +#endif
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2