From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id EC7123858024 for ; Fri, 26 Mar 2021 11:05:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EC7123858024 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1CD0CAE03; Fri, 26 Mar 2021 11:05:14 +0000 (UTC) Date: Fri, 26 Mar 2021 12:05:12 +0100 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org Subject: [committed] Add -p auto and -e auto Message-ID: <20210326110510.GA8776@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 11:05:17 -0000 Hi, Add new option argument auto for both -p and -e, to describe the current behaviour more explicitly. Committed to trunk. Thanks, - Tom Add -p auto and -e auto 2021-03-26 Tom de Vries * args.c (usage, parse_args): Add auto option argument to -p and -e. * dwz.1 (-p, -e): Add auto option argument. --- args.c | 16 +++++++++++++--- dwz.1 | 10 ++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/args.c b/args.c index ee4e067..d44e632 100644 --- a/args.c +++ b/args.c @@ -233,9 +233,9 @@ static struct option_help dwz_multi_file_options_help[] = { "5", "dwarf-5", NULL, NULL, "Emit DWARF 5 standardized supplementary object files instead of" " GNU extension .debug_altlink." }, - { "p", "multifile-pointer-size", "SIZE", NULL, + { "p", "multifile-pointer-size", "", "auto", "Set pointer size of multifile, in number of bytes." }, - { "e", "multifile-endian", "", NULL, + { "e", "multifile-endian", "", "auto", "Set endianity of multifile." }, { "j", "jobs", "", "number of processors / 2", "Process files in parallel" } @@ -381,7 +381,7 @@ usage (int failing) FILE *stream = failing ? stderr : stdout; const char *header_lines[] = { "dwz [common options] [-h] [-m COMMONFILE] [-M NAME | -r] [-5]", - " [-p SIZE] [-e ] [-j N] [FILES]", + " [-p ] [-e ] [-j N] [FILES]", "dwz [common options] -o OUTFILE FILE", "dwz [ -v | -? ]" }; @@ -641,6 +641,11 @@ parse_args (int argc, char *argv[], bool *hardlink, const char **outfile) break; case 'p': + if (strcmp (optarg, "auto") == 0) + { + multifile_force_ptr_size = 0; + break; + } l = strtoul (optarg, &end, 0); if (*end != '\0' || optarg == end || (unsigned int) l != l) error (1, 0, "invalid argument -l %s", optarg); @@ -648,6 +653,11 @@ parse_args (int argc, char *argv[], bool *hardlink, const char **outfile) break; case 'e': + if (strcmp (optarg, "auto") == 0) + { + multifile_force_endian = 0; + break; + } if (strlen (optarg) != 1) error (1, 0, "invalid argument -l %s", optarg); switch (optarg[0]) diff --git a/dwz.1 b/dwz.1 index 2fa32f3..6fec6ed 100644 --- a/dwz.1 +++ b/dwz.1 @@ -77,11 +77,13 @@ the executable or shared library to the file named in the argument 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 -Specify the pointer size of the multifile, in bytes. +.B \-p N \-\-multifile-pointer-size +Specify the pointer size of the multifile, in bytes. If auto, use the +pointer size of the files, provided they match. .TP -.B \-p \-\-multifile-endian -Specify the endianity of the multifile. +.B \-p \-\-multifile-endian +Specify the endianity of the multifile. If auto, use the endianity of +the files, provided they match. .TP .B \-q \-\-quiet Silence up some of the most common messages.