[PATCH] Add --multifile-pointer-size <n> and --multifile-endian <l|L|b|B>
Mark Wielaard
mark@klomp.org
Thu Mar 25 20:44:58 GMT 2021
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
More information about the Dwz
mailing list