From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 26BD63858001 for ; Thu, 25 Mar 2021 20:46:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 26BD63858001 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from librem (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 24A033032F92; Thu, 25 Mar 2021 21:46:15 +0100 (CET) Received: by librem (Postfix, from userid 1000) id D7B07C3587; Thu, 25 Mar 2021 21:44:58 +0100 (CET) Date: Thu, 25 Mar 2021 21:44:58 +0100 From: Mark Wielaard To: Tom de Vries Cc: dwz@sourceware.org, jakub@redhat.com Subject: Re: [PATCH] Add --multifile-pointer-size and --multifile-endian Message-ID: <20210325204458.GH2685@wildebeest.org> References: <20210325152333.GA8326@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210325152333.GA8326@delia> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Thu, 25 Mar 2021 20:46:17 -0000 Hi Tom, On Thu, Mar 25, 2021 at 04:23:35PM +0100, Tom de Vries wrote: > Consider binaries: > - hello.64 generated using -m64, with pointer size 8, > - hello.32 generated using -m32, with pointer size 4. > > When trying to generate a multifile using files with different > pointer sizes, we get: > ... > $ cp ../hello.64 1; cp 1 2; \ > cp ../hello.32 3; cp 3 4; \ > dwz -m 5 1 2 3 4; echo $? > dwz: Multi-file optimization not allowed for different pointer sizes \ > or endianity > 0 > ... > and the multi-file optimization has not been applied for any file: > ... > $ for f in 1 2 3 4; do \ > echo -n "$f: "; \ > readelf -S -W $f \ > | grep -c gnu_debugaltlink; \ > done > 1: 0 > 2: 0 > 3: 0 > 4: 0 > ... > > Add an option --multifile-pointer-size / -p that sets the pointer size > of the multifile, such that we have instead with say -p 8: > ... > $ cp ../hello.64 1; cp 1 2; \ > cp ../hello.32 3; cp 3 4; \ > ./dwz -m 5 -p 8 1 2 3 4; echo $? > ./dwz: File 3 skipped for multi-file optimization, different pointer size > ./dwz: File 4 skipped for multi-file optimization, different pointer size > 0 > ... > and: > ... > $ for f in 1 2 3 4; do \ > echo -n "$f: "; \ > readelf -S -W $f \ > | grep -c gnu_debugaltlink; \ > done > 1: 1 > 2: 1 > 3: 0 > 4: 0 > ... > > Likewise, add --multifile-endian / -e . > > Any comments? Would it make sense to default to the ptrsize/endianity of the native arch we are running on? Instead of the ptrsize/endianity of the first file seen? Cheers, Mark