public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Tom de Vries <tdevries@suse.de>
Cc: dwz@sourceware.org, jakub@redhat.com
Subject: Re: [PATCH] Add --multifile-pointer-size <n> and --multifile-endian <l|L|b|B>
Date: Thu, 25 Mar 2021 21:44:58 +0100	[thread overview]
Message-ID: <20210325204458.GH2685@wildebeest.org> (raw)
In-Reply-To: <20210325152333.GA8326@delia>

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 <n> / -p <n> 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 <l|L|b|B> / -e <l|L|b|B>.
> 
> 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

      reply	other threads:[~2021-03-25 20:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 15:23 Tom de Vries
2021-03-25 20:44 ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210325204458.GH2685@wildebeest.org \
    --to=mark@klomp.org \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).