Binutils causes abnormally large, non-working binaries since 2.43

Dimitry Andric dimitry@andric.com
Mon Feb 17 13:08:35 GMT 2025


On 17 Feb 2025, at 13:56, Dimitry Andric <dimitry@andric.com> wrote:
> 
> On 17 Feb 2025, at 12:55, Bastiaan Timmer <basjetimmer@yahoo.com> wrote:
>> On 17-02-2025 11:58, Julian Waters wrote:
>>> Unfortunately even binutils 2.42 still yields a Java Virtual Machine bloated to extreme sizes. It seems the 2 issues are unrelated.
> ...
>> 
>> I just realized: it is of course possible that just downgrading binutils is not enough.
>> 
>> For example in my case, I noticed the size increase in a program I was linking against openssl. Just downgrading binutils would not fix this, unless I also recompiled openssl _after_ that downgrade. So, I of course don't know anything about that JVM, but maybe it is possible its size increase is due to one of its dependencies having bloated in size, and that needs to be rebuilt with the old binutils version first.
...
> Hence, it looks like the compiler/assembler in 2.43 now outputs aligned sections, filling them with zero bytes.
> 
>  $ objdump -j .xdata -s libcommon-lib-ciphercommon_block.obj
> 
>  libcommon-lib-ciphercommon_block.obj:     file format pe-x86-64
> 
>  Contents of section .xdata:
>   0000 010e0600 0e320a30 09600870 075006c0  .....2.0.`.p.P..
>   0010 010a0300 0a420630 05600000 01040000  .....B.0.`......
>   0020 01080100 08420000 01060200 06300560  .....B.......0.`
>   0030 00000000 00000000 00000000 00000000  ................
>   0040 00000000 00000000 00000000 00000000  ................
>   0050 00000000 00000000 00000000 00000000  ................
>   ... lots more zeros ...
>   0fe0 00000000 00000000 00000000 00000000  ................
>   0ff0 00000000 00000000 00000000 00000000  ................
> 
> Bisecting might help to find where this behavior change occurred.

My first guess would be https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=121a3f4b4f4aac216abe239f6f3bd491b63e5e34, "Update objcopy's --section-alignment option so that it sets the alignment flag on PE sections". But I'm unsure whether the build process for this openssl package is using objcopy.

-Dimitry



More information about the Binutils mailing list